Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1393)

Unified Diff: chrome/test/automation/automation_proxy_uitest.cc

Issue 155941: Make AutomationProxyTest.NavigateToURLWithTimeout* tests not-flaky. (Closed)
Patch Set: maintainability fixes Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/automation_proxy_uitest.cc
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index 5739ca51eeafa60ae0ad2b5ddec87a1ebef133c1..943d90c63ad33fecfe92072556f96cb712e0b931 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -12,6 +12,7 @@
#include "base/string_util.h"
#include "build/build_config.h"
#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/browser/automation/url_request_slow_http_job.h"
#include "chrome/browser/view_ids.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
@@ -287,6 +288,14 @@ TEST_F(AutomationProxyTest, NavigateToURLWithTimeout1) {
std::wstring title;
ASSERT_TRUE(tab->GetTabTitle(&title));
ASSERT_STREQ(L"Title Of Awesomeness", title.c_str());
+
+ // Use timeout high enough to allow the browser to create a url request job.
+ const int kLowTimeoutMs = 250;
+ ASSERT_GE(URLRequestSlowHTTPJob::kDelayMs, kLowTimeoutMs);
+ tab->NavigateToURLWithTimeout(
+ URLRequestSlowHTTPJob::GetMockUrl(filename.ToWStringHack()),
+ kLowTimeoutMs, &is_timeout);
+ ASSERT_TRUE(is_timeout);
}
TEST_F(AutomationProxyTest, NavigateToURLWithTimeout2) {
@@ -299,8 +308,13 @@ TEST_F(AutomationProxyTest, NavigateToURLWithTimeout2) {
filename1 = filename1.AppendASCII("title1.html");
bool is_timeout;
- tab->NavigateToURLWithTimeout(net::FilePathToFileURL(filename1),
- 1, &is_timeout);
+
+ // Use timeout high enough to allow the browser to create a url request job.
+ const int kLowTimeoutMs = 250;
+ ASSERT_GE(URLRequestSlowHTTPJob::kDelayMs, kLowTimeoutMs);
+ tab->NavigateToURLWithTimeout(
+ URLRequestSlowHTTPJob::GetMockUrl(filename1.ToWStringHack()),
+ kLowTimeoutMs, &is_timeout);
ASSERT_TRUE(is_timeout);
FilePath filename2(test_data_directory_);
« no previous file with comments | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698