| 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 "chrome/test/base/web_ui_browsertest.h" | 5 #include "chrome/test/base/web_ui_browsertest.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 // page is shown. While this doesn't matter for most tests, without it, | 324 // page is shown. While this doesn't matter for most tests, without it, |
| 325 // navigation to different anchors cannot be listened to (via the hashchange | 325 // navigation to different anchors cannot be listened to (via the hashchange |
| 326 // event). | 326 // event). |
| 327 class MockWebUIDataSource : public content::URLDataSource { | 327 class MockWebUIDataSource : public content::URLDataSource { |
| 328 public: | 328 public: |
| 329 MockWebUIDataSource() {} | 329 MockWebUIDataSource() {} |
| 330 | 330 |
| 331 private: | 331 private: |
| 332 virtual ~MockWebUIDataSource() {} | 332 virtual ~MockWebUIDataSource() {} |
| 333 | 333 |
| 334 virtual std::string GetSource() OVERRIDE { | 334 virtual std::string GetSource() const OVERRIDE { |
| 335 return "dummyurl"; | 335 return "dummyurl"; |
| 336 } | 336 } |
| 337 | 337 |
| 338 virtual void StartDataRequest( | 338 virtual void StartDataRequest( |
| 339 const std::string& path, | 339 const std::string& path, |
| 340 bool is_incognito, | 340 bool is_incognito, |
| 341 const content::URLDataSource::GotDataCallback& callback) OVERRIDE { | 341 const content::URLDataSource::GotDataCallback& callback) OVERRIDE { |
| 342 std::string dummy_html = "<html><body>Dummy</body></html>"; | 342 std::string dummy_html = "<html><body>Dummy</body></html>"; |
| 343 scoped_refptr<base::RefCountedString> response = | 343 scoped_refptr<base::RefCountedString> response = |
| 344 base::RefCountedString::TakeString(&dummy_html); | 344 base::RefCountedString::TakeString(&dummy_html); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 // testDone directly and expect pass result. | 771 // testDone directly and expect pass result. |
| 772 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { | 772 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { |
| 773 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); | 773 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); |
| 774 } | 774 } |
| 775 | 775 |
| 776 // Test that calling testDone during RunJavascriptTest still completes when | 776 // Test that calling testDone during RunJavascriptTest still completes when |
| 777 // waiting for async result. | 777 // waiting for async result. |
| 778 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { | 778 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { |
| 779 ASSERT_TRUE(RunJavascriptTest("testDone")); | 779 ASSERT_TRUE(RunJavascriptTest("testDone")); |
| 780 } | 780 } |
| OLD | NEW |