Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1349)

Side by Side Diff: chrome/test/base/web_ui_browsertest.cc

Issue 13945023: Make URLDataSource::GetSource() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And another one. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/theme_source.cc ('k') | content/browser/webui/shared_resources_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698