OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 100 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
101 tab->render_view_host(), std::wstring(), | 101 tab->render_view_host(), std::wstring(), |
102 L"window.domAutomationController.send(IsWorkerFinished());", | 102 L"window.domAutomationController.send(IsWorkerFinished());", |
103 &workerFinished)); | 103 &workerFinished)); |
104 | 104 |
105 if (workerFinished) | 105 if (workerFinished) |
106 break; | 106 break; |
107 | 107 |
108 // Wait a bit. | 108 // Wait a bit. |
109 MessageLoop::current()->PostDelayedTask( | 109 MessageLoop::current()->PostDelayedTask( |
110 FROM_HERE, new MessageLoop::QuitTask, timeout_ms); | 110 FROM_HERE, MessageLoop::QuitClosure(), timeout_ms); |
111 ui_test_utils::RunMessageLoop(); | 111 ui_test_utils::RunMessageLoop(); |
112 } | 112 } |
113 | 113 |
114 bool actuallyLoadedContent = false; | 114 bool actuallyLoadedContent = false; |
115 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 115 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
116 tab->render_view_host(), std::wstring(), | 116 tab->render_view_host(), std::wstring(), |
117 L"window.domAutomationController.send(IsContentLoaded());", | 117 L"window.domAutomationController.send(IsContentLoaded());", |
118 &actuallyLoadedContent)); | 118 &actuallyLoadedContent)); |
119 EXPECT_EQ(expectLoaded, actuallyLoadedContent); | 119 EXPECT_EQ(expectLoaded, actuallyLoadedContent); |
120 } | 120 } |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 ui_test_utils::NavigateToURL(browser(), | 871 ui_test_utils::NavigateToURL(browser(), |
872 test_server()->GetURL(replacement_path)); | 872 test_server()->GetURL(replacement_path)); |
873 | 873 |
874 TabContents* tab1 = browser()->GetSelectedTabContents(); | 874 TabContents* tab1 = browser()->GetSelectedTabContents(); |
875 // It is probably overkill to add a notification for a popup-opening, let's | 875 // It is probably overkill to add a notification for a popup-opening, let's |
876 // just poll. | 876 // just poll. |
877 for (int i = 0; i < 10; i++) { | 877 for (int i = 0; i < 10; i++) { |
878 if (GetConstrainedWindowCount() > 0) | 878 if (GetConstrainedWindowCount() > 0) |
879 break; | 879 break; |
880 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 880 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
881 new MessageLoop::QuitTask(), 1000); | 881 MessageLoop::QuitClosure(), 1000); |
882 ui_test_utils::RunMessageLoop(); | 882 ui_test_utils::RunMessageLoop(); |
883 } | 883 } |
884 ASSERT_EQ(1, GetConstrainedWindowCount()); | 884 ASSERT_EQ(1, GetConstrainedWindowCount()); |
885 | 885 |
886 // Let's add another tab to make sure the browser does not exit when we close | 886 // Let's add another tab to make sure the browser does not exit when we close |
887 // the first tab. | 887 // the first tab. |
888 GURL url = test_server()->GetURL("files/ssl/google.html"); | 888 GURL url = test_server()->GetURL("files/ssl/google.html"); |
889 ui_test_utils::WindowedNotificationObserver observer( | 889 ui_test_utils::WindowedNotificationObserver observer( |
890 content::NOTIFICATION_LOAD_STOP, | 890 content::NOTIFICATION_LOAD_STOP, |
891 content::NotificationService::AllSources()); | 891 content::NotificationService::AllSources()); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 | 1299 |
1300 // Visit a page over https that contains a frame with a redirect. | 1300 // Visit a page over https that contains a frame with a redirect. |
1301 | 1301 |
1302 // XMLHttpRequest insecure content in synchronous mode. | 1302 // XMLHttpRequest insecure content in synchronous mode. |
1303 | 1303 |
1304 // XMLHttpRequest insecure content in asynchronous mode. | 1304 // XMLHttpRequest insecure content in asynchronous mode. |
1305 | 1305 |
1306 // XMLHttpRequest over bad ssl in synchronous mode. | 1306 // XMLHttpRequest over bad ssl in synchronous mode. |
1307 | 1307 |
1308 // XMLHttpRequest over OK ssl in synchronous mode. | 1308 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |