summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_browsertest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 09:36:11 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 09:36:11 +0000
commit57af2bf65a7b7ece04cc74d5419bc9d703bfbd03 (patch)
tree4207bc3bc902a082c94ffe5fb254c3de63f2b2a4 /chrome/browser/extensions/extension_browsertest.cc
parent9f707efe660ffca94893bfc34a8ea60f7e9a7a31 (diff)
downloadchromium_src-57af2bf65a7b7ece04cc74d5419bc9d703bfbd03.zip
chromium_src-57af2bf65a7b7ece04cc74d5419bc9d703bfbd03.tar.gz
chromium_src-57af2bf65a7b7ece04cc74d5419bc9d703bfbd03.tar.bz2
[GTTF] Remove the internal timeout of extension browser tests.
Now we have a global timeout for browser tests enforced by out of process test launcher. Having too many different timeouts all over the place makes debugging issues harder. TEST=browser_tests BUG=none Review URL: http://codereview.chromium.org/1046001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_browsertest.cc')
-rw-r--r--chrome/browser/extensions/extension_browsertest.cc31
1 files changed, 5 insertions, 26 deletions
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index 7041fab..5f214fd 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -25,11 +25,6 @@
#include "chrome/common/notification_type.h"
#include "chrome/test/ui_test_utils.h"
-// Amount of time to wait to load an extension. This is purposely obscenely
-// long because it will only get used in the case of failure and we want to
-// minimize false positives.
-static const int kTimeoutMs = 60 * 1000; // 1 minute
-
ExtensionBrowserTest::ExtensionBrowserTest()
: target_page_action_count_(-1),
target_visible_page_action_count_(-1) {
@@ -60,8 +55,6 @@ bool ExtensionBrowserTest::LoadExtensionImpl(const FilePath& path,
registrar.Add(this, NotificationType::EXTENSION_LOADED,
NotificationService::AllSources());
service->LoadExtension(path);
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE, new MessageLoop::QuitTask, kTimeoutMs);
ui_test_utils::RunMessageLoop();
}
size_t num_after = service->extensions()->size();
@@ -137,8 +130,6 @@ bool ExtensionBrowserTest::InstallOrUpdateExtension(const std::string& id,
installer->set_expected_id(id);
installer->InstallCrx(path);
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE, new MessageLoop::QuitTask, kTimeoutMs);
ui_test_utils::RunMessageLoop();
}
@@ -169,7 +160,7 @@ void ExtensionBrowserTest::ReloadExtension(const std::string& extension_id) {
ExtensionsService* service = browser()->profile()->GetExtensionsService();
service->ReloadExtension(extension_id);
ui_test_utils::RegisterAndWait(NotificationType::EXTENSION_PROCESS_CREATED,
- this, kTimeoutMs);
+ this);
}
void ExtensionBrowserTest::UnloadExtension(const std::string& extension_id) {
@@ -198,9 +189,6 @@ bool ExtensionBrowserTest::WaitForPageActionCountChangeTo(int count) {
NotificationType::EXTENSION_PAGE_ACTION_COUNT_CHANGED,
NotificationService::AllSources());
- MessageLoop::current()->PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask,
- kTimeoutMs);
-
target_page_action_count_ = count;
LocationBarTesting* location_bar =
browser()->window()->GetLocationBar()->GetLocationBarForTesting();
@@ -215,9 +203,6 @@ bool ExtensionBrowserTest::WaitForPageActionVisibilityChangeTo(int count) {
NotificationType::EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
NotificationService::AllSources());
- MessageLoop::current()->PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask,
- kTimeoutMs);
-
target_visible_page_action_count_ = count;
LocationBarTesting* location_bar =
browser()->window()->GetLocationBar()->GetLocationBarForTesting();
@@ -254,25 +239,19 @@ bool ExtensionBrowserTest::WaitForExtensionHostsToLoad() {
bool ExtensionBrowserTest::WaitForExtensionInstall() {
int before = extension_installs_observed_;
- ui_test_utils::RegisterAndWait(NotificationType::EXTENSION_INSTALLED, this,
- kTimeoutMs);
+ ui_test_utils::RegisterAndWait(NotificationType::EXTENSION_INSTALLED, this);
return extension_installs_observed_ == (before + 1);
}
bool ExtensionBrowserTest::WaitForExtensionInstallError() {
int before = extension_installs_observed_;
ui_test_utils::RegisterAndWait(NotificationType::EXTENSION_INSTALL_ERROR,
- this, kTimeoutMs);
+ this);
return extension_installs_observed_ == before;
}
void ExtensionBrowserTest::WaitForExtensionLoad() {
- NotificationRegistrar registrar;
- registrar.Add(this, NotificationType::EXTENSION_LOADED,
- NotificationService::AllSources());
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE, new MessageLoop::QuitTask, kTimeoutMs);
- ui_test_utils::RunMessageLoop();
+ ui_test_utils::RegisterAndWait(NotificationType::EXTENSION_LOADED, this);
WaitForExtensionHostsToLoad();
}
@@ -285,7 +264,7 @@ bool ExtensionBrowserTest::WaitForExtensionCrash(
return true;
}
ui_test_utils::RegisterAndWait(NotificationType::EXTENSION_PROCESS_TERMINATED,
- this, kTimeoutMs);
+ this);
return (service->GetExtensionById(extension_id, true) == NULL);
}