diff options
author | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 01:27:19 +0000 |
---|---|---|
committer | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 01:27:19 +0000 |
commit | c2f36e3a9b5884bbf77d08a6deb6117a7b81d939 (patch) | |
tree | ac0e4aaa3fbf930d483ec0e5b069e6b6620db318 /chrome/browser/extensions/app_process_apitest.cc | |
parent | 8284e14632e2dd3d695907d1c212cfe47944d415 (diff) | |
download | chromium_src-c2f36e3a9b5884bbf77d08a6deb6117a7b81d939.zip chromium_src-c2f36e3a9b5884bbf77d08a6deb6117a7b81d939.tar.gz chromium_src-c2f36e3a9b5884bbf77d08a6deb6117a7b81d939.tar.bz2 |
Enable BookmarkAppGetsNormalProcess test.
BUG=104649
TEST=AppApiTest.BookmarkAppGetsNormalProcess passes
Review URL: http://codereview.chromium.org/8870008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114333 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/app_process_apitest.cc')
-rw-r--r-- | chrome/browser/extensions/app_process_apitest.cc | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index f2caf8d..0ae9ead 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -14,6 +14,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" +#include "chrome/common/extensions/extension_file_util.h" #include "chrome/test/base/ui_test_utils.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" @@ -253,26 +254,28 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcessInstances) { // Tests that bookmark apps do not use the app process model and are treated // like normal web pages instead. http://crbug.com/104636. -// TODO(creis): This test is disabled until we have a way to load a bookmark -// app in browser_tests. See http://crbug.com/104649. -IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_BookmarkAppGetsNormalProcess) { +IN_PROC_BROWSER_TEST_F(AppApiTest, BookmarkAppGetsNormalProcess) { CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisablePopupBlocking); - extensions::ProcessMap* process_map = - browser()->profile()->GetExtensionService()->process_map(); + ExtensionService* service = browser()->profile()->GetExtensionService(); + extensions::ProcessMap* process_map = service->process_map(); host_resolver()->AddRule("*", "127.0.0.1"); ASSERT_TRUE(test_server()->Start()); - - // TODO(creis): We need a way to load an app in a test as a bookmark app. - // Until then, from_bookmark() will return false and this test will fail. - const Extension* extension = - LoadExtension(test_data_dir_.AppendASCII("app_process")); - ASSERT_TRUE(extension); - EXPECT_TRUE(extension->from_bookmark()); GURL base_url = GetTestBaseURL("app_process"); + // Load an app as a bookmark app. + std::string error; + scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( + test_data_dir_.AppendASCII("app_process"), + Extension::LOAD, + Extension::FROM_BOOKMARK, + &error)); + service->OnExtensionInstalled(extension, false, 0); + ASSERT_TRUE(extension.get()); + ASSERT_TRUE(extension->from_bookmark()); + // Test both opening a URL in a new tab, and opening a tab and then navigating // it. Either way, bookmark app tabs should be considered normal processes // with no elevated privileges and no WebUI bindings. |