diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-21 09:58:01 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-21 09:58:01 +0000 |
commit | a320e51df14cf5f2112783b8390fc77e3bf0c569 (patch) | |
tree | 8424e0fe1efe545fccc5e7b3f4b6d08e8341d366 /chrome/browser/extensions/extension_apitest.cc | |
parent | a4949656364a4d4ad177eedfda6f4d4228f1155b (diff) | |
download | chromium_src-a320e51df14cf5f2112783b8390fc77e3bf0c569.zip chromium_src-a320e51df14cf5f2112783b8390fc77e3bf0c569.tar.gz chromium_src-a320e51df14cf5f2112783b8390fc77e3bf0c569.tar.bz2 |
Do not create an incogntio profile as side effect when listing all tabs/windows.
BUG=55479
TEST=DontCreateIncognitoProfile
Review URL: http://codereview.chromium.org/3412005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_apitest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_apitest.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index 3ebbeed..f5a5173 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -78,13 +78,17 @@ void ExtensionApiTest::ResultCatcher::Observe( } bool ExtensionApiTest::RunExtensionTest(const char* extension_name) { - return RunExtensionTestImpl(extension_name, ""); + return RunExtensionTestImpl(extension_name, "", false); +} + +bool ExtensionApiTest::RunExtensionTestIncognito(const char* extension_name) { + return RunExtensionTestImpl(extension_name, "", true); } bool ExtensionApiTest::RunExtensionSubtest(const char* extension_name, const std::string& page_url) { DCHECK(!page_url.empty()) << "Argument page_url is required."; - return RunExtensionTestImpl(extension_name, page_url); + return RunExtensionTestImpl(extension_name, page_url, false); } bool ExtensionApiTest::RunPageTest(const std::string& page_url) { @@ -94,7 +98,8 @@ bool ExtensionApiTest::RunPageTest(const std::string& page_url) { // Load |extension_name| extension and/or |page_url| and wait for // PASSED or FAILED notification. bool ExtensionApiTest::RunExtensionTestImpl(const char* extension_name, - const std::string& page_url) { + const std::string& page_url, + bool enable_incognito) { ResultCatcher catcher; DCHECK(!std::string(extension_name).empty() || !page_url.empty()) << "extension_name and page_url cannot both be empty"; @@ -102,7 +107,10 @@ bool ExtensionApiTest::RunExtensionTestImpl(const char* extension_name, if (!std::string(extension_name).empty()) { LOG(INFO) << "Loading Extension: " << extension_name; - if (!LoadExtension(test_data_dir_.AppendASCII(extension_name))) { + bool loaded = enable_incognito ? + LoadExtensionIncognito(test_data_dir_.AppendASCII(extension_name)) : + LoadExtension(test_data_dir_.AppendASCII(extension_name)); + if (!loaded) { message_ = "Failed to load extension."; return false; } |