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/browser/ui/webui/web_ui_browsertest.h" | 5 #include "chrome/browser/ui/webui/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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 private: | 261 private: |
262 virtual ~MockWebUIDataSource() {} | 262 virtual ~MockWebUIDataSource() {} |
263 | 263 |
264 virtual void StartDataRequest(const std::string& path, | 264 virtual void StartDataRequest(const std::string& path, |
265 bool is_incognito, | 265 bool is_incognito, |
266 int request_id) OVERRIDE { | 266 int request_id) OVERRIDE { |
267 std::string dummy_html = "<html><body>Dummy</body></html>"; | 267 std::string dummy_html = "<html><body>Dummy</body></html>"; |
268 scoped_refptr<base::RefCountedString> response = | 268 scoped_refptr<base::RefCountedString> response = |
269 base::RefCountedString::TakeString(&dummy_html); | 269 base::RefCountedString::TakeString(&dummy_html); |
270 SendResponse(request_id, response); | 270 SendResponse(request_id, response.get()); |
271 } | 271 } |
272 | 272 |
273 std::string GetMimeType(const std::string& path) const OVERRIDE { | 273 std::string GetMimeType(const std::string& path) const OVERRIDE { |
274 return "text/html"; | 274 return "text/html"; |
275 } | 275 } |
276 | 276 |
277 DISALLOW_COPY_AND_ASSIGN(MockWebUIDataSource); | 277 DISALLOW_COPY_AND_ASSIGN(MockWebUIDataSource); |
278 }; | 278 }; |
279 | 279 |
280 // WebUIProvider to allow attaching the DataSource for the dummy URL when | 280 // WebUIProvider to allow attaching the DataSource for the dummy URL when |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 // testDone directly and expect pass result. | 698 // testDone directly and expect pass result. |
699 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { | 699 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { |
700 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); | 700 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); |
701 } | 701 } |
702 | 702 |
703 // Test that calling testDone during RunJavascriptTest still completes when | 703 // Test that calling testDone during RunJavascriptTest still completes when |
704 // waiting for async result. | 704 // waiting for async result. |
705 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { | 705 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { |
706 ASSERT_TRUE(RunJavascriptTest("testDone")); | 706 ASSERT_TRUE(RunJavascriptTest("testDone")); |
707 } | 707 } |
OLD | NEW |