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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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/path_service.h" 6 #include "base/path_service.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 virtual void DidFailProvisionalLoad( 76 virtual void DidFailProvisionalLoad(
77 int64 frame_id, 77 int64 frame_id,
78 bool is_main_frame, 78 bool is_main_frame,
79 const GURL& validated_url, 79 const GURL& validated_url,
80 int error_code, 80 int error_code,
81 const string16& error_description, 81 const string16& error_description,
82 content::RenderViewHost* render_view_host) OVERRIDE { 82 content::RenderViewHost* render_view_host) OVERRIDE {
83 seen_ = true; 83 seen_ = true;
84 if (waiting_) 84 if (waiting_)
85 MessageLoopForUI::current()->Quit(); 85 base::MessageLoopForUI::current()->Quit();
86 } 86 }
87 87
88 private: 88 private:
89 bool waiting_; 89 bool waiting_;
90 bool seen_; 90 bool seen_;
91 }; 91 };
92 92
93 } // namespace 93 } // namespace
94 94
95 class SSLUITest : public InProcessBrowserTest { 95 class SSLUITest : public InProcessBrowserTest {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 bool workerFinished = false; 184 bool workerFinished = false;
185 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 185 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
186 tab, 186 tab,
187 "window.domAutomationController.send(IsWorkerFinished());", 187 "window.domAutomationController.send(IsWorkerFinished());",
188 &workerFinished)); 188 &workerFinished));
189 189
190 if (workerFinished) 190 if (workerFinished)
191 break; 191 break;
192 192
193 // Wait a bit. 193 // Wait a bit.
194 MessageLoop::current()->PostDelayedTask( 194 base::MessageLoop::current()->PostDelayedTask(
195 FROM_HERE, 195 FROM_HERE,
196 MessageLoop::QuitClosure(), 196 base::MessageLoop::QuitClosure(),
197 base::TimeDelta::FromMilliseconds(timeout_ms)); 197 base::TimeDelta::FromMilliseconds(timeout_ms));
198 content::RunMessageLoop(); 198 content::RunMessageLoop();
199 } 199 }
200 200
201 bool actuallyLoadedContent = false; 201 bool actuallyLoadedContent = false;
202 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 202 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
203 tab, 203 tab,
204 "window.domAutomationController.send(IsContentLoaded());", 204 "window.domAutomationController.send(IsContentLoaded());",
205 &actuallyLoadedContent)); 205 &actuallyLoadedContent));
206 EXPECT_EQ(expectLoaded, actuallyLoadedContent); 206 EXPECT_EQ(expectLoaded, actuallyLoadedContent);
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 1150
1151 ui_test_utils::NavigateToURL(browser(), 1151 ui_test_utils::NavigateToURL(browser(),
1152 test_server()->GetURL(replacement_path)); 1152 test_server()->GetURL(replacement_path));
1153 1153
1154 WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents(); 1154 WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents();
1155 // It is probably overkill to add a notification for a popup-opening, let's 1155 // It is probably overkill to add a notification for a popup-opening, let's
1156 // just poll. 1156 // just poll.
1157 for (int i = 0; i < 10; i++) { 1157 for (int i = 0; i < 10; i++) {
1158 if (IsShowingWebContentsModalDialog()) 1158 if (IsShowingWebContentsModalDialog())
1159 break; 1159 break;
1160 MessageLoop::current()->PostDelayedTask( 1160 base::MessageLoop::current()->PostDelayedTask(
1161 FROM_HERE, MessageLoop::QuitClosure(), base::TimeDelta::FromSeconds(1)); 1161 FROM_HERE,
1162 base::MessageLoop::QuitClosure(),
1163 base::TimeDelta::FromSeconds(1));
1162 content::RunMessageLoop(); 1164 content::RunMessageLoop();
1163 } 1165 }
1164 ASSERT_TRUE(IsShowingWebContentsModalDialog()); 1166 ASSERT_TRUE(IsShowingWebContentsModalDialog());
1165 1167
1166 // Let's add another tab to make sure the browser does not exit when we close 1168 // Let's add another tab to make sure the browser does not exit when we close
1167 // the first tab. 1169 // the first tab.
1168 GURL url = test_server()->GetURL("files/ssl/google.html"); 1170 GURL url = test_server()->GetURL("files/ssl/google.html");
1169 content::WindowedNotificationObserver observer( 1171 content::WindowedNotificationObserver observer(
1170 content::NOTIFICATION_LOAD_STOP, 1172 content::NOTIFICATION_LOAD_STOP,
1171 content::NotificationService::AllSources()); 1173 content::NotificationService::AllSources());
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 1634
1633 // Visit a page over https that contains a frame with a redirect. 1635 // Visit a page over https that contains a frame with a redirect.
1634 1636
1635 // XMLHttpRequest insecure content in synchronous mode. 1637 // XMLHttpRequest insecure content in synchronous mode.
1636 1638
1637 // XMLHttpRequest insecure content in asynchronous mode. 1639 // XMLHttpRequest insecure content in asynchronous mode.
1638 1640
1639 // XMLHttpRequest over bad ssl in synchronous mode. 1641 // XMLHttpRequest over bad ssl in synchronous mode.
1640 1642
1641 // XMLHttpRequest over OK ssl in synchronous mode. 1643 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698