Commit 9c73efaf authored by aa@chromium.org's avatar aa@chromium.org

Add some logging to a flakey browsertest to debug.

Review URL: http://codereview.chromium.org/149291

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20103 0039d316-1c4b-4281-b951-d872f2087c98
parent 1b1a9d34
...@@ -68,8 +68,14 @@ bool ExtensionBrowserTest::InstallExtension(const FilePath& path) { ...@@ -68,8 +68,14 @@ bool ExtensionBrowserTest::InstallExtension(const FilePath& path) {
registrar_.Remove(this, NotificationType::EXTENSION_INSTALLED, registrar_.Remove(this, NotificationType::EXTENSION_INSTALLED,
NotificationService::AllSources()); NotificationService::AllSources());
size_t num_after = service->extensions()->size(); size_t num_after = service->extensions()->size();
if (num_after != (num_before + 1)) if (num_after != (num_before + 1)) {
std::cout << "Num extensions before: " << IntToString(num_before)
<< "num after: " << IntToString(num_after)
<< "Installed extensions are:\n";
for (size_t i = 0; i < service->extensions()->size(); ++i)
std::cout << " " << service->extensions()->at(i)->id() << "\n";
return false; return false;
}
return WaitForExtensionHostsToLoad(); return WaitForExtensionHostsToLoad();
} }
...@@ -89,8 +95,11 @@ bool ExtensionBrowserTest::WaitForExtensionHostsToLoad() { ...@@ -89,8 +95,11 @@ bool ExtensionBrowserTest::WaitForExtensionHostsToLoad() {
for (ExtensionProcessManager::const_iterator iter = manager->begin(); for (ExtensionProcessManager::const_iterator iter = manager->begin();
iter != manager->end(); ++iter) { iter != manager->end(); ++iter) {
while (!(*iter)->did_stop_loading()) { while (!(*iter)->did_stop_loading()) {
if ((base::Time::Now() - start_time).InMilliseconds() > kTimeoutMs) if ((base::Time::Now() - start_time).InMilliseconds() > kTimeoutMs) {
std::cout << "Extension host did not load for URL: "
<< (*iter)->GetURL().spec();
return false; return false;
}
MessageLoop::current()->PostDelayedTask(FROM_HERE, MessageLoop::current()->PostDelayedTask(FROM_HERE,
new MessageLoop::QuitTask, 200); new MessageLoop::QuitTask, 200);
......
...@@ -76,7 +76,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Shelf) { ...@@ -76,7 +76,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Shelf) {
// Tests that installing and uninstalling extensions don't crash with an // Tests that installing and uninstalling extensions don't crash with an
// incognito window open. // incognito window open.
// This test is disabled. see bug 16106. // This test is disabled. see bug 16106.
#if 0
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Incognito) { IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Incognito) {
// Open an incognito window to the extensions management page. We just // Open an incognito window to the extensions management page. We just
// want to make sure that we don't crash while playing with extensions when // want to make sure that we don't crash while playing with extensions when
...@@ -87,7 +86,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Incognito) { ...@@ -87,7 +86,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Incognito) {
ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("good.crx"))); ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("good.crx")));
UninstallExtension("ldnnhddmnhbkjipkidpdiheffobcpfmf"); UninstallExtension("ldnnhddmnhbkjipkidpdiheffobcpfmf");
} }
#endif
// Tests that we can load extension pages into the tab area and they can call // Tests that we can load extension pages into the tab area and they can call
// extension APIs. // extension APIs.
......
...@@ -124,6 +124,11 @@ void InProcessBrowserTest::SetUp() { ...@@ -124,6 +124,11 @@ void InProcessBrowserTest::SetUp() {
command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath, command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath,
subprocess_path); subprocess_path);
// Enable warning level logging so that we can see when bad stuff happens.
command_line->AppendSwitch(switches::kEnableLogging);
command_line->AppendSwitchWithValue(switches::kLoggingLevel,
IntToWString(1)); // warning
SandboxInitWrapper sandbox_wrapper; SandboxInitWrapper sandbox_wrapper;
MainFunctionParams params(*command_line, sandbox_wrapper, NULL); MainFunctionParams params(*command_line, sandbox_wrapper, NULL);
params.ui_task = params.ui_task =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment