diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-11 19:19:58 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-11 19:19:58 +0000 |
commit | acd1c2aeac51c6b6d425f6f6ab705923da024605 (patch) | |
tree | 1382c20210d3168ab59ede3b11b7becce73a4b2d | |
parent | 29eed247319db96326d73a2f609ea25a2428f832 (diff) | |
download | chromium_src-acd1c2aeac51c6b6d425f6f6ab705923da024605.zip chromium_src-acd1c2aeac51c6b6d425f6f6ab705923da024605.tar.gz chromium_src-acd1c2aeac51c6b6d425f6f6ab705923da024605.tar.bz2 |
Add some logging to IncognitoSplitMode to try to figure out why it's crashing.
BUG=53991
TEST=no
Review URL: http://codereview.chromium.org/3651001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62169 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_apitest.cc | 5 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_incognito_apitest.cc | 70 |
2 files changed, 40 insertions, 35 deletions
diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index da9e01c..28ecc68 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -43,6 +43,7 @@ bool ExtensionApiTest::ResultCatcher::GetNextResult() { return ret; } + LOG(INFO) << "DEBUG: results aren't empty"; NOTREACHED(); return false; } @@ -57,7 +58,7 @@ void ExtensionApiTest::ResultCatcher::Observe( switch (type.value) { case NotificationType::EXTENSION_TEST_PASSED: - LOG(INFO) << "Got EXTENSION_TEST_PASSED notification."; + LOG(INFO) << "Got EXTENSION_TEST_PASSED notification (" << this << ")."; results_.push_back(true); messages_.push_back(""); if (waiting_) @@ -65,7 +66,7 @@ void ExtensionApiTest::ResultCatcher::Observe( break; case NotificationType::EXTENSION_TEST_FAILED: - LOG(INFO) << "Got EXTENSION_TEST_FAILED notification."; + LOG(INFO) << "Got EXTENSION_TEST_FAILED notification (" << this << ")."; results_.push_back(false); messages_.push_back(*(Details<std::string>(details).ptr())); if (waiting_) diff --git a/chrome/browser/extensions/extension_incognito_apitest.cc b/chrome/browser/extensions/extension_incognito_apitest.cc index 14a9f7d..abe5267 100644 --- a/chrome/browser/extensions/extension_incognito_apitest.cc +++ b/chrome/browser/extensions/extension_incognito_apitest.cc @@ -105,44 +105,48 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Incognito) { EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); } -// Crashes flakily on Linux and Mac. http://crbug.com/53991 -#if defined(OS_LINUX) || defined(OS_MACOSX) -#define MAYBE_IncognitoSplitMode FLAKY_IncognitoSplitMode -#else -#define MAYBE_IncognitoSplitMode IncognitoSplitMode -#endif - // Tests that the APIs in an incognito-enabled split-mode extension work // properly. -IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_IncognitoSplitMode) { +// TODO(mpcomplete): Crashes flakily. http://crbug.com/53991 +IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_IncognitoSplitMode) { host_resolver()->AddRule("*", "127.0.0.1"); ASSERT_TRUE(test_server()->Start()); - // We need 2 ResultCatchers because we'll be running the same test in both - // regular and incognito mode. - ResultCatcher catcher; - catcher.RestrictToProfile(browser()->profile()); - ResultCatcher catcher_incognito; - catcher_incognito.RestrictToProfile( - browser()->profile()->GetOffTheRecordProfile()); - - // Open incognito window and navigate to test page. - ui_test_utils::OpenURLOffTheRecord(browser()->profile(), - GURL("http://www.example.com:1337/files/extensions/test_file.html")); - - ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ - .AppendASCII("incognito").AppendASCII("split"))); - - // Wait for both extensions to be ready before telling them to proceed. - ExtensionTestMessageListener listener("waiting", true); - EXPECT_TRUE(listener.WaitUntilSatisfied()); - ExtensionTestMessageListener listener_incognito("waiting", true); - EXPECT_TRUE(listener_incognito.WaitUntilSatisfied()); - listener.Reply("go"); - listener_incognito.Reply("go"); - - EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); - EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); + { + // We need 2 ResultCatchers because we'll be running the same test in both + // regular and incognito mode. + ResultCatcher catcher; + catcher.RestrictToProfile(browser()->profile()); + ResultCatcher catcher_incognito; + catcher_incognito.RestrictToProfile( + browser()->profile()->GetOffTheRecordProfile()); + + // Open incognito window and navigate to test page. + ui_test_utils::OpenURLOffTheRecord(browser()->profile(), + GURL("http://www.example.com:1337/files/extensions/test_file.html")); + + LOG(INFO) << "DEBUG: Loading extension"; + + ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_. + AppendASCII("incognito").AppendASCII("split"))); + + LOG(INFO) << "DEBUG: waiting for message"; + + // Wait for both extensions to be ready before telling them to proceed. + ExtensionTestMessageListener listener("waiting", true); + EXPECT_TRUE(listener.WaitUntilSatisfied()); + ExtensionTestMessageListener listener_incognito("waiting", true); + EXPECT_TRUE(listener_incognito.WaitUntilSatisfied()); + listener.Reply("go"); + listener_incognito.Reply("go"); + + LOG(INFO) << "DEBUG: Get result for normal"; + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); + LOG(INFO) << "DEBUG: Get result for incognito"; + EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); + LOG(INFO) << "DEBUG: Got results"; + } + LOG(INFO) << "DEBUG: ResultCatcher destroyed."; } // Tests that the APIs in an incognito-disabled extension don't see incognito |