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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 9597005: Revert 124890 - Convert uses of int ms to TimeDelta in chrome/browser and net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/time.h" 6 #include "base/time.h"
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/tabs/tab_strip_model.h" 8 #include "chrome/browser/tabs/tab_strip_model.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_navigator.h" 10 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 122 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
123 tab->GetRenderViewHost(), std::wstring(), 123 tab->GetRenderViewHost(), std::wstring(),
124 L"window.domAutomationController.send(IsWorkerFinished());", 124 L"window.domAutomationController.send(IsWorkerFinished());",
125 &workerFinished)); 125 &workerFinished));
126 126
127 if (workerFinished) 127 if (workerFinished)
128 break; 128 break;
129 129
130 // Wait a bit. 130 // Wait a bit.
131 MessageLoop::current()->PostDelayedTask( 131 MessageLoop::current()->PostDelayedTask(
132 FROM_HERE, 132 FROM_HERE, MessageLoop::QuitClosure(), timeout_ms);
133 MessageLoop::QuitClosure(),
134 base::TimeDelta::FromMilliseconds(timeout_ms));
135 ui_test_utils::RunMessageLoop(); 133 ui_test_utils::RunMessageLoop();
136 } 134 }
137 135
138 bool actuallyLoadedContent = false; 136 bool actuallyLoadedContent = false;
139 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 137 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
140 tab->GetRenderViewHost(), std::wstring(), 138 tab->GetRenderViewHost(), std::wstring(),
141 L"window.domAutomationController.send(IsContentLoaded());", 139 L"window.domAutomationController.send(IsContentLoaded());",
142 &actuallyLoadedContent)); 140 &actuallyLoadedContent));
143 EXPECT_EQ(expectLoaded, actuallyLoadedContent); 141 EXPECT_EQ(expectLoaded, actuallyLoadedContent);
144 } 142 }
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 884
887 ui_test_utils::NavigateToURL(browser(), 885 ui_test_utils::NavigateToURL(browser(),
888 test_server()->GetURL(replacement_path)); 886 test_server()->GetURL(replacement_path));
889 887
890 WebContents* tab1 = browser()->GetSelectedWebContents(); 888 WebContents* tab1 = browser()->GetSelectedWebContents();
891 // It is probably overkill to add a notification for a popup-opening, let's 889 // It is probably overkill to add a notification for a popup-opening, let's
892 // just poll. 890 // just poll.
893 for (int i = 0; i < 10; i++) { 891 for (int i = 0; i < 10; i++) {
894 if (GetConstrainedWindowCount() > 0) 892 if (GetConstrainedWindowCount() > 0)
895 break; 893 break;
896 MessageLoop::current()->PostDelayedTask( 894 MessageLoop::current()->PostDelayedTask(FROM_HERE,
897 FROM_HERE, MessageLoop::QuitClosure(), base::TimeDelta::FromSeconds(1)); 895 MessageLoop::QuitClosure(), 1000);
898 ui_test_utils::RunMessageLoop(); 896 ui_test_utils::RunMessageLoop();
899 } 897 }
900 ASSERT_EQ(1, GetConstrainedWindowCount()); 898 ASSERT_EQ(1, GetConstrainedWindowCount());
901 899
902 // Let's add another tab to make sure the browser does not exit when we close 900 // Let's add another tab to make sure the browser does not exit when we close
903 // the first tab. 901 // the first tab.
904 GURL url = test_server()->GetURL("files/ssl/google.html"); 902 GURL url = test_server()->GetURL("files/ssl/google.html");
905 ui_test_utils::WindowedNotificationObserver observer( 903 ui_test_utils::WindowedNotificationObserver observer(
906 content::NOTIFICATION_LOAD_STOP, 904 content::NOTIFICATION_LOAD_STOP,
907 content::NotificationService::AllSources()); 905 content::NotificationService::AllSources());
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 1328
1331 // Visit a page over https that contains a frame with a redirect. 1329 // Visit a page over https that contains a frame with a redirect.
1332 1330
1333 // XMLHttpRequest insecure content in synchronous mode. 1331 // XMLHttpRequest insecure content in synchronous mode.
1334 1332
1335 // XMLHttpRequest insecure content in asynchronous mode. 1333 // XMLHttpRequest insecure content in asynchronous mode.
1336 1334
1337 // XMLHttpRequest over bad ssl in synchronous mode. 1335 // XMLHttpRequest over bad ssl in synchronous mode.
1338 1336
1339 // XMLHttpRequest over OK ssl in synchronous mode. 1337 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/protector/settings_change_global_error.cc ('k') | net/base/cookie_store_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698