OLD | NEW |
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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" |
9 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
10 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "base/single_thread_task_runner.h" |
11 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
12 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/thread_task_runner_handle.h" |
14 #include "base/time/time.h" | 17 #include "base/time/time.h" |
15 #include "chrome/app/chrome_command_ids.h" | 18 #include "chrome/app/chrome_command_ids.h" |
16 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
18 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" | 21 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" |
19 #include "chrome/browser/net/certificate_error_reporter.h" | 22 #include "chrome/browser/net/certificate_error_reporter.h" |
20 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ssl/cert_logger.pb.h" | 24 #include "chrome/browser/ssl/cert_logger.pb.h" |
22 #include "chrome/browser/ssl/cert_report_helper.h" | 25 #include "chrome/browser/ssl/cert_report_helper.h" |
23 #include "chrome/browser/ssl/certificate_error_report.h" | 26 #include "chrome/browser/ssl/certificate_error_report.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 bool worker_finished = false; | 256 bool worker_finished = false; |
254 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 257 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
255 tab, | 258 tab, |
256 "window.domAutomationController.send(IsWorkerFinished());", | 259 "window.domAutomationController.send(IsWorkerFinished());", |
257 &worker_finished)); | 260 &worker_finished)); |
258 | 261 |
259 if (worker_finished) | 262 if (worker_finished) |
260 break; | 263 break; |
261 | 264 |
262 // Wait a bit. | 265 // Wait a bit. |
263 base::MessageLoop::current()->PostDelayedTask( | 266 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
264 FROM_HERE, | 267 FROM_HERE, base::MessageLoop::QuitClosure(), |
265 base::MessageLoop::QuitClosure(), | |
266 base::TimeDelta::FromMilliseconds(kTimeoutMS)); | 268 base::TimeDelta::FromMilliseconds(kTimeoutMS)); |
267 content::RunMessageLoop(); | 269 content::RunMessageLoop(); |
268 } | 270 } |
269 | 271 |
270 bool actually_loaded_content = false; | 272 bool actually_loaded_content = false; |
271 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 273 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
272 tab, | 274 tab, |
273 "window.domAutomationController.send(IsContentLoaded());", | 275 "window.domAutomationController.send(IsContentLoaded());", |
274 &actually_loaded_content)); | 276 &actually_loaded_content)); |
275 EXPECT_EQ(expected_load, actually_loaded_content); | 277 EXPECT_EQ(expected_load, actually_loaded_content); |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 | 1527 |
1526 ui_test_utils::NavigateToURL(browser(), | 1528 ui_test_utils::NavigateToURL(browser(), |
1527 test_server()->GetURL(replacement_path)); | 1529 test_server()->GetURL(replacement_path)); |
1528 | 1530 |
1529 WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents(); | 1531 WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents(); |
1530 // It is probably overkill to add a notification for a popup-opening, let's | 1532 // It is probably overkill to add a notification for a popup-opening, let's |
1531 // just poll. | 1533 // just poll. |
1532 for (int i = 0; i < 10; i++) { | 1534 for (int i = 0; i < 10; i++) { |
1533 if (IsShowingWebContentsModalDialog()) | 1535 if (IsShowingWebContentsModalDialog()) |
1534 break; | 1536 break; |
1535 base::MessageLoop::current()->PostDelayedTask( | 1537 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
1536 FROM_HERE, | 1538 FROM_HERE, base::MessageLoop::QuitClosure(), |
1537 base::MessageLoop::QuitClosure(), | |
1538 base::TimeDelta::FromSeconds(1)); | 1539 base::TimeDelta::FromSeconds(1)); |
1539 content::RunMessageLoop(); | 1540 content::RunMessageLoop(); |
1540 } | 1541 } |
1541 ASSERT_TRUE(IsShowingWebContentsModalDialog()); | 1542 ASSERT_TRUE(IsShowingWebContentsModalDialog()); |
1542 | 1543 |
1543 // Let's add another tab to make sure the browser does not exit when we close | 1544 // Let's add another tab to make sure the browser does not exit when we close |
1544 // the first tab. | 1545 // the first tab. |
1545 GURL url = test_server()->GetURL("files/ssl/google.html"); | 1546 GURL url = test_server()->GetURL("files/ssl/google.html"); |
1546 content::WindowedNotificationObserver observer( | 1547 content::WindowedNotificationObserver observer( |
1547 content::NOTIFICATION_LOAD_STOP, | 1548 content::NOTIFICATION_LOAD_STOP, |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2245 | 2246 |
2246 // Visit a page over https that contains a frame with a redirect. | 2247 // Visit a page over https that contains a frame with a redirect. |
2247 | 2248 |
2248 // XMLHttpRequest insecure content in synchronous mode. | 2249 // XMLHttpRequest insecure content in synchronous mode. |
2249 | 2250 |
2250 // XMLHttpRequest insecure content in asynchronous mode. | 2251 // XMLHttpRequest insecure content in asynchronous mode. |
2251 | 2252 |
2252 // XMLHttpRequest over bad ssl in synchronous mode. | 2253 // XMLHttpRequest over bad ssl in synchronous mode. |
2253 | 2254 |
2254 // XMLHttpRequest over OK ssl in synchronous mode. | 2255 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |