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 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | 4 #include "chrome/browser/ui/webui/web_ui_browsertest.h" |
5 | 5 |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 const std::string& preload_test_name) { | 179 const std::string& preload_test_name) { |
180 // Remember for callback OnJsInjectionReady(). | 180 // Remember for callback OnJsInjectionReady(). |
181 preload_test_fixture_ = preload_test_fixture; | 181 preload_test_fixture_ = preload_test_fixture; |
182 preload_test_name_ = preload_test_name; | 182 preload_test_name_ = preload_test_name; |
183 | 183 |
184 TestNavigationObserver navigation_observer( | 184 TestNavigationObserver navigation_observer( |
185 Source<NavigationController>( | 185 Source<NavigationController>( |
186 &browser()->GetSelectedTabContentsWrapper()->controller()), | 186 &browser()->GetSelectedTabContentsWrapper()->controller()), |
187 this, 1); | 187 this, 1); |
188 browser::NavigateParams params( | 188 browser::NavigateParams params( |
189 browser(), GURL(browse_to), PageTransition::TYPED); | 189 browser(), GURL(browse_to), content::PAGE_TRANSITION_TYPED); |
190 params.disposition = CURRENT_TAB; | 190 params.disposition = CURRENT_TAB; |
191 browser::Navigate(¶ms); | 191 browser::Navigate(¶ms); |
192 navigation_observer.WaitForObservation(); | 192 navigation_observer.WaitForObservation(); |
193 } | 193 } |
194 | 194 |
195 void WebUIBrowserTest::BrowsePrintPreload( | 195 void WebUIBrowserTest::BrowsePrintPreload( |
196 const GURL& browse_to, | 196 const GURL& browse_to, |
197 const std::string& preload_test_fixture, | 197 const std::string& preload_test_fixture, |
198 const std::string& preload_test_name) { | 198 const std::string& preload_test_name) { |
199 // Remember for callback OnJsInjectionReady(). | 199 // Remember for callback OnJsInjectionReady(). |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 // testDone directly and expect pass result. | 595 // testDone directly and expect pass result. |
596 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { | 596 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { |
597 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); | 597 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); |
598 } | 598 } |
599 | 599 |
600 // Test that calling testDone during RunJavascriptTest still completes when | 600 // Test that calling testDone during RunJavascriptTest still completes when |
601 // waiting for async result. | 601 // waiting for async result. |
602 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { | 602 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { |
603 ASSERT_TRUE(RunJavascriptTest("testDone")); | 603 ASSERT_TRUE(RunJavascriptTest("testDone")); |
604 } | 604 } |
OLD | NEW |