summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-15 08:33:24 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-15 08:33:24 +0000
commit448a3db9010e3435f8218fac33f31605021652b2 (patch)
tree2f5706c0f08deb947b49f0f0f5c55fedd6be716d /chrome
parent753245e840c7f3a996efeb9dc42d380ca15ad846 (diff)
downloadchromium_src-448a3db9010e3435f8218fac33f31605021652b2.zip
chromium_src-448a3db9010e3435f8218fac33f31605021652b2.tar.gz
chromium_src-448a3db9010e3435f8218fac33f31605021652b2.tar.bz2
[GTTF] Check the result value of StartHTTPServer to avoid
test hangs in cases when the server fails to start. The tests will still fail in that case, obviously, but will no longer hang (or crash), which is an improvement. TEST=browser_tests BUG=none Review URL: http://codereview.chromium.org/2095004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/app_background_page_apitest.cc4
-rw-r--r--chrome/browser/extensions/app_process_apitest.cc2
-rw-r--r--chrome/browser/extensions/browser_action_apitest.cc4
-rw-r--r--chrome/browser/extensions/content_script_all_frames_apitest.cc4
-rw-r--r--chrome/browser/extensions/content_script_extension_process_apitest.cc2
-rw-r--r--chrome/browser/extensions/cross_origin_xhr_apitest.cc2
-rw-r--r--chrome/browser/extensions/execute_script_apitest.cc4
-rw-r--r--chrome/browser/extensions/extension_clipboard_apitest.cc2
-rw-r--r--chrome/browser/extensions/extension_history_apitest.cc2
-rw-r--r--chrome/browser/extensions/extension_incognito_apitest.cc10
-rw-r--r--chrome/browser/extensions/extension_javascript_url_apitest.cc2
-rw-r--r--chrome/browser/extensions/extension_messages_apitest.cc2
-rw-r--r--chrome/browser/extensions/extension_tabs_apitest.cc6
-rw-r--r--chrome/browser/extensions/fragment_navigation_apitest.cc4
-rw-r--r--chrome/browser/extensions/isolated_world_apitest.cc2
-rw-r--r--chrome/browser/extensions/page_action_apitest.cc2
-rw-r--r--chrome/browser/geolocation/geolocation_browsertest.cc44
-rw-r--r--chrome/test/automation/dom_automation_browsertest.cc18
-rw-r--r--chrome/test/in_process_browser_test.h3
19 files changed, 65 insertions, 54 deletions
diff --git a/chrome/browser/extensions/app_background_page_apitest.cc b/chrome/browser/extensions/app_background_page_apitest.cc
index 06fb044..f16dad3 100644
--- a/chrome/browser/extensions/app_background_page_apitest.cc
+++ b/chrome/browser/extensions/app_background_page_apitest.cc
@@ -19,7 +19,7 @@ class AppBackgroundPageApiTest : public ExtensionApiTest {
IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, Basic) {
host_resolver()->AddRule("a.com", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
LoadExtension(test_data_dir_.AppendASCII(
"app_background_page/app_has_permission"));
@@ -28,7 +28,7 @@ IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, Basic) {
IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, LacksPermission) {
host_resolver()->AddRule("a.com", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
LoadExtension(test_data_dir_.AppendASCII(
"app_background_page/app_lacks_permission"));
diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc
index c86e165..35ee14f 100644
--- a/chrome/browser/extensions/app_process_apitest.cc
+++ b/chrome/browser/extensions/app_process_apitest.cc
@@ -61,7 +61,7 @@ static void NavigateTabHelper(TabContents* contents, const GURL& url) {
// This test is flaky, see bug 42497.
IN_PROC_BROWSER_TEST_F(AppApiTest, FLAKY_AppProcess) {
host_resolver()->AddRule("*", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("app_process")) << message_;
diff --git a/chrome/browser/extensions/browser_action_apitest.cc b/chrome/browser/extensions/browser_action_apitest.cc
index 0551142..e52aecb 100644
--- a/chrome/browser/extensions/browser_action_apitest.cc
+++ b/chrome/browser/extensions/browser_action_apitest.cc
@@ -55,7 +55,7 @@ class BrowserActionApiTest : public ExtensionApiTest {
};
IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, Basic) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("browser_action/basics")) << message_;
Extension* extension = GetSingleLoadedExtension();
ASSERT_TRUE(extension) << message_;
@@ -276,7 +276,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, BrowserActionRemovePopup) {
}
IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, MAYBE_IncognitoBasic) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("browser_action/basics")) << message_;
Extension* extension = GetSingleLoadedExtension();
diff --git a/chrome/browser/extensions/content_script_all_frames_apitest.cc b/chrome/browser/extensions/content_script_all_frames_apitest.cc
index 3903ff0..13be5fd 100644
--- a/chrome/browser/extensions/content_script_all_frames_apitest.cc
+++ b/chrome/browser/extensions/content_script_all_frames_apitest.cc
@@ -5,11 +5,11 @@
#include "chrome/browser/extensions/extension_apitest.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptAllFrames) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/all_frames")) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptExtensionIframe) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/extension_iframe")) << message_;
}
diff --git a/chrome/browser/extensions/content_script_extension_process_apitest.cc b/chrome/browser/extensions/content_script_extension_process_apitest.cc
index 48f92f1..16258fa 100644
--- a/chrome/browser/extensions/content_script_extension_process_apitest.cc
+++ b/chrome/browser/extensions/content_script_extension_process_apitest.cc
@@ -10,6 +10,6 @@
#include "chrome/test/ui_test_utils.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptExtensionProcess) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/extension_process")) << message_;
}
diff --git a/chrome/browser/extensions/cross_origin_xhr_apitest.cc b/chrome/browser/extensions/cross_origin_xhr_apitest.cc
index c43c612..a2cf9d8 100644
--- a/chrome/browser/extensions/cross_origin_xhr_apitest.cc
+++ b/chrome/browser/extensions/cross_origin_xhr_apitest.cc
@@ -7,6 +7,6 @@
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CrossOriginXHR) {
host_resolver()->AddRule("*.com", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("cross_origin_xhr")) << message_;
}
diff --git a/chrome/browser/extensions/execute_script_apitest.cc b/chrome/browser/extensions/execute_script_apitest.cc
index 3b07add..07c141c 100644
--- a/chrome/browser/extensions/execute_script_apitest.cc
+++ b/chrome/browser/extensions/execute_script_apitest.cc
@@ -12,7 +12,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_ExecuteScript) {
host_resolver()->AddRuleWithLatency("a.com", "127.0.0.1", 500);
host_resolver()->AddRule("b.com", "127.0.0.1");
host_resolver()->AddRule("c.com", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("executescript/basic")) << message_;
ASSERT_TRUE(RunExtensionTest("executescript/in_frame")) << message_;
@@ -23,7 +23,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_ExecuteScript) {
// (ExecuteScript) tests are de-flakified, reunite this case with it's brethern.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ExecuteScriptFileAfterClose) {
host_resolver()->AddRule("b.com", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("executescript/file_after_close")) << message_;
}
diff --git a/chrome/browser/extensions/extension_clipboard_apitest.cc b/chrome/browser/extensions/extension_clipboard_apitest.cc
index 8198c9a..cfabacf 100644
--- a/chrome/browser/extensions/extension_clipboard_apitest.cc
+++ b/chrome/browser/extensions/extension_clipboard_apitest.cc
@@ -10,6 +10,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Clipboard) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExperimentalExtensionApis);
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("clipboard")) << message_;
}
diff --git a/chrome/browser/extensions/extension_history_apitest.cc b/chrome/browser/extensions/extension_history_apitest.cc
index 8124a18..a9a99ef 100644
--- a/chrome/browser/extensions/extension_history_apitest.cc
+++ b/chrome/browser/extensions/extension_history_apitest.cc
@@ -11,7 +11,7 @@
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_History) {
host_resolver()->AddRule("www.a.com", "127.0.0.1");
host_resolver()->AddRule("www.b.com", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("history")) << message_;
}
diff --git a/chrome/browser/extensions/extension_incognito_apitest.cc b/chrome/browser/extensions/extension_incognito_apitest.cc
index dda3ce7..15649ff 100644
--- a/chrome/browser/extensions/extension_incognito_apitest.cc
+++ b/chrome/browser/extensions/extension_incognito_apitest.cc
@@ -25,7 +25,7 @@
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, IncognitoNoScript) {
host_resolver()->AddRule("*", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
// Loads a simple extension which attempts to change the title of every page
// that loads to "modified".
@@ -51,7 +51,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, IncognitoNoScript) {
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, IncognitoYesScript) {
host_resolver()->AddRule("*", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
// Load a dummy extension. This just tests that we don't regress a
// crash fix when multiple incognito- and non-incognito-enabled extensions
@@ -89,7 +89,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, IncognitoYesScript) {
// Flaky, http://crbug.com/42844.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_Incognito) {
host_resolver()->AddRule("*", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ResultCatcher catcher;
@@ -107,7 +107,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_Incognito) {
// events or callbacks.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoDisabled) {
host_resolver()->AddRule("*", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ResultCatcher catcher;
@@ -124,7 +124,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoDisabled) {
// Test that opening a popup from an incognito browser window works properly.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_IncognitoPopup) {
host_resolver()->AddRule("*", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ResultCatcher catcher;
diff --git a/chrome/browser/extensions/extension_javascript_url_apitest.cc b/chrome/browser/extensions/extension_javascript_url_apitest.cc
index 657f82d..601a9e4 100644
--- a/chrome/browser/extensions/extension_javascript_url_apitest.cc
+++ b/chrome/browser/extensions/extension_javascript_url_apitest.cc
@@ -8,7 +8,7 @@
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, JavaScriptURLPermissions) {
host_resolver()->AddRule("a.com", "127.0.0.1");
host_resolver()->AddRule("b.com", "127.0.0.1");
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("tabs/javascript_url_permissions")) << message_;
}
diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc
index cc412d9..43703750 100644
--- a/chrome/browser/extensions/extension_messages_apitest.cc
+++ b/chrome/browser/extensions/extension_messages_apitest.cc
@@ -50,7 +50,7 @@ class MessageSender : public NotificationObserver {
// Tests that message passing between extensions and content scripts works.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Messaging) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("messaging/connect")) << message_;
}
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc
index ded47cb..7da6dad 100644
--- a/chrome/browser/extensions/extension_tabs_apitest.cc
+++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -11,7 +11,7 @@
// Disabled due to timeouts, see http://crbug.com/39843, http://crbug.com/43440.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_Tabs) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
// The test creates a tab and checks that the URL of the new tab
// is that of the new tab page. Make sure the pref that controls
@@ -23,7 +23,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_Tabs) {
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Tabs2) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
// This test runs through additional tabs functionality.
browser()->profile()->GetPrefs()->SetBoolean(
@@ -33,7 +33,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Tabs2) {
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CaptureVisibleTab) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("tabs/capture_visible_tab")) << message_;
}
diff --git a/chrome/browser/extensions/fragment_navigation_apitest.cc b/chrome/browser/extensions/fragment_navigation_apitest.cc
index 00bc536..d44c35a 100644
--- a/chrome/browser/extensions/fragment_navigation_apitest.cc
+++ b/chrome/browser/extensions/fragment_navigation_apitest.cc
@@ -6,13 +6,13 @@
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptFragmentNavigation) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
const char* extension_name = "content_scripts/fragment";
ASSERT_TRUE(RunExtensionTest(extension_name)) << message_;
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ExecuteScriptFragmentNavigation) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
const char* extension_name = "executescript/fragment";
ASSERT_TRUE(RunExtensionTest(extension_name)) << message_;
}
diff --git a/chrome/browser/extensions/isolated_world_apitest.cc b/chrome/browser/extensions/isolated_world_apitest.cc
index 198f39a..f3ef0eb 100644
--- a/chrome/browser/extensions/isolated_world_apitest.cc
+++ b/chrome/browser/extensions/isolated_world_apitest.cc
@@ -7,7 +7,7 @@
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IsolatedWorld1) {
// This extension runs various bits of script and tests that they all run in
// the same isolated world.
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("content_scripts/isolated_world1")) << message_;
// Now load a different extension, inject into same page, verify worlds aren't
diff --git a/chrome/browser/extensions/page_action_apitest.cc b/chrome/browser/extensions/page_action_apitest.cc
index c165623..6eb30dd 100644
--- a/chrome/browser/extensions/page_action_apitest.cc
+++ b/chrome/browser/extensions/page_action_apitest.cc
@@ -15,7 +15,7 @@
#include "chrome/test/ui_test_utils.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PageAction) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("page_action/basics")) << message_;
Extension* extension = GetSingleLoadedExtension();
ASSERT_TRUE(extension) << message_;
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 9bfbae7..146f955 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/compiler_specific.h"
#include "base/string_util.h"
#include "base/waitable_event.h"
#include "chrome/browser/app_modal_dialog.h"
@@ -199,11 +200,15 @@ class GeolocationBrowserTest : public InProcessBrowserTest {
INITIALIZATION_IFRAMES,
};
- void Initialize(InitializationOptions options) {
+ bool Initialize(InitializationOptions options) WARN_UNUSED_RESULT {
GeolocationArbitrator::SetProviderFactoryForTest(
&NewAutoSuccessMockNetworkLocationProvider);
- if (!server_.get())
+ if (!server_.get()) {
server_ = StartHTTPServer();
+ EXPECT_TRUE(server_.get());
+ if (!server_.get())
+ return false;
+ }
current_url_ = server_->TestServerPage(html_for_tests_);
LOG(WARNING) << "before navigate";
@@ -228,8 +233,13 @@ class GeolocationBrowserTest : public InProcessBrowserTest {
current_browser_ = browser();
ui_test_utils::NavigateToURL(current_browser_, current_url_);
}
- EXPECT_TRUE(current_browser_);
LOG(WARNING) << "after navigate";
+
+ EXPECT_TRUE(current_browser_);
+ if (!current_browser_)
+ return false;
+
+ return true;
}
void AddGeolocationWatch(bool wait_for_infobar) {
@@ -342,7 +352,7 @@ class GeolocationBrowserTest : public InProcessBrowserTest {
#endif
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_DisplaysPermissionBar) {
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
AddGeolocationWatch(true);
}
@@ -355,7 +365,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_DisplaysPermissionBar) {
#endif
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_Geoposition) {
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
AddGeolocationWatch(true);
SetInfobarResponse(current_url_, true);
CheckGeoposition(MockLocationProvider::instance_->position_);
@@ -370,7 +380,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_Geoposition) {
#endif
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_ErrorOnPermissionDenied) {
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
AddGeolocationWatch(true);
// Infobar was displayed, deny access and check for error code.
SetInfobarResponse(current_url_, false);
@@ -386,14 +396,14 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_ErrorOnPermissionDenied) {
#endif
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForSecondTab) {
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
AddGeolocationWatch(true);
SetInfobarResponse(current_url_, true);
// Disables further prompts from this tab.
CheckStringValueFromJavascript("false", "geoEnableAlerts(false)");
// Checks infobar will not be created a second tab.
- Initialize(INITIALIZATION_NEWTAB);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NEWTAB));
AddGeolocationWatch(false);
CheckGeoposition(MockLocationProvider::instance_->position_);
}
@@ -407,14 +417,14 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForSecondTab) {
#endif
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForDeniedOrigin) {
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
current_browser_->profile()->GetGeolocationContentSettingsMap()->
SetContentSetting(current_url_, current_url_, CONTENT_SETTING_BLOCK);
AddGeolocationWatch(false);
// Checks we have an error for this denied origin.
CheckStringValueFromJavascript("1", "geoGetLastError()");
// Checks infobar will not be created a second tab.
- Initialize(INITIALIZATION_NEWTAB);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NEWTAB));
AddGeolocationWatch(false);
CheckStringValueFromJavascript("1", "geoGetLastError()");
}
@@ -429,7 +439,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForDeniedOrigin) {
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
MAYBE_NoInfobarForAllowedOrigin) {
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
current_browser_->profile()->GetGeolocationContentSettingsMap()->
SetContentSetting(current_url_, current_url_, CONTENT_SETTING_ALLOW);
// Checks no infobar will be created and there's no error callback.
@@ -447,7 +457,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForOffTheRecord) {
// First, check infobar will be created for regular profile
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
AddGeolocationWatch(true);
// Response will be persisted
SetInfobarResponse(current_url_, true);
@@ -455,7 +465,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForOffTheRecord) {
// Disables further prompts from this tab.
CheckStringValueFromJavascript("false", "geoEnableAlerts(false)");
// Go off the record, and checks no infobar will be created.
- Initialize(INITIALIZATION_OFFTHERECORD);
+ ASSERT_TRUE(Initialize(INITIALIZATION_OFFTHERECORD));
AddGeolocationWatch(false);
CheckGeoposition(MockLocationProvider::instance_->position_);
}
@@ -471,7 +481,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForOffTheRecord) {
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
MAYBE_IFramesWithFreshPosition) {
html_for_tests_ = "files/geolocation/iframes_different_origin.html";
- Initialize(INITIALIZATION_IFRAMES);
+ ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES));
LOG(WARNING) << "frames loaded";
iframe_xpath_ = L"//iframe[@id='iframe_0']";
@@ -519,7 +529,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
MAYBE_IFramesWithCachedPosition) {
html_for_tests_ = "files/geolocation/iframes_different_origin.html";
- Initialize(INITIALIZATION_IFRAMES);
+ ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES));
iframe_xpath_ = L"//iframe[@id='iframe_0']";
AddGeolocationWatch(true);
@@ -558,7 +568,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
MAYBE_CancelPermissionForFrame) {
html_for_tests_ = "files/geolocation/iframes_different_origin.html";
- Initialize(INITIALIZATION_IFRAMES);
+ ASSERT_TRUE(Initialize(INITIALIZATION_IFRAMES));
LOG(WARNING) << "frames loaded";
iframe_xpath_ = L"//iframe[@id='iframe_0']";
@@ -595,7 +605,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest,
// Tests that an invalid URL (e.g. from a popup window) is rejected
// correctly. Also acts as a regression test for http://crbug.com/40478
html_for_tests_ = "files/geolocation/invalid_request_url.html";
- Initialize(INITIALIZATION_NONE);
+ ASSERT_TRUE(Initialize(INITIALIZATION_NONE));
TabContents* original_tab = current_browser_->GetSelectedTabContents();
CheckStringValueFromJavascript("1", "requestGeolocationFromInvalidUrl()");
CheckStringValueFromJavascriptForTab("1", "isAlive()", original_tab);
diff --git a/chrome/test/automation/dom_automation_browsertest.cc b/chrome/test/automation/dom_automation_browsertest.cc
index f922e0e..7085395 100644
--- a/chrome/test/automation/dom_automation_browsertest.cc
+++ b/chrome/test/automation/dom_automation_browsertest.cc
@@ -31,7 +31,7 @@ class DOMAutomationTest : public InProcessBrowserTest {
typedef DOMElementProxy::By By;
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, FindByXPath) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(),
GetTestURL("find_elements/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -75,7 +75,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, FindByXPath) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, FindBySelectors) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(),
GetTestURL("find_elements/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -117,7 +117,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, FindBySelectors) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, FindByText) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(),
GetTestURL("find_elements/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -163,7 +163,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, FindByText) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, WaitFor1VisibleElement) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(), GetTestURL("wait/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -174,7 +174,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, WaitFor1VisibleElement) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, WaitForElementsToDisappear) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(), GetTestURL("wait/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -185,7 +185,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, WaitForElementsToDisappear) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, EnsureAttributeEventuallyMatches) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(), GetTestURL("wait/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -196,7 +196,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, EnsureAttributeEventuallyMatches) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, Frames) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(), GetTestURL("frames/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -236,7 +236,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, Frames) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, Events) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(), GetTestURL("events/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
@@ -264,7 +264,7 @@ IN_PROC_BROWSER_TEST_F(DOMAutomationTest, Events) {
}
IN_PROC_BROWSER_TEST_F(DOMAutomationTest, StringEscape) {
- StartHTTPServer();
+ ASSERT_TRUE(StartHTTPServer());
ui_test_utils::NavigateToURL(browser(),
GetTestURL("string_escape/test.html"));
DOMElementProxyRef main_doc = ui_test_utils::GetActiveDOMDocument(browser());
diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h
index f2ea5ae..337b593 100644
--- a/chrome/test/in_process_browser_test.h
+++ b/chrome/test/in_process_browser_test.h
@@ -5,6 +5,7 @@
#ifndef CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_
#define CHROME_TEST_IN_PROCESS_BROWSER_TEST_H_
+#include "base/compiler_specific.h"
#include "net/url_request/url_request_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -96,7 +97,7 @@ class InProcessBrowserTest : public testing::Test {
void SetInitialTimeoutInMS(int initial_timeout);
// Starts an HTTP server.
- HTTPTestServer* StartHTTPServer();
+ HTTPTestServer* StartHTTPServer() WARN_UNUSED_RESULT;
// Creates a browser with a single tab (about:blank), waits for the tab to
// finish loading and shows the browser.