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

Side by Side Diff: chrome/browser/ui/webui/web_ui_browsertest.cc

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Made ChromeURLDataManager's destructor virtual Created 8 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
« no previous file with comments | « chrome/browser/ui/webui/uber/uber_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // testing. 273 // testing.
274 class MockWebUIProvider 274 class MockWebUIProvider
275 : public TestChromeWebUIControllerFactory::WebUIProvider { 275 : public TestChromeWebUIControllerFactory::WebUIProvider {
276 public: 276 public:
277 MockWebUIProvider() {} 277 MockWebUIProvider() {}
278 278
279 // Returns a new WebUI 279 // Returns a new WebUI
280 WebUIController* NewWebUI(content::WebUI* web_ui, const GURL& url) OVERRIDE { 280 WebUIController* NewWebUI(content::WebUI* web_ui, const GURL& url) OVERRIDE {
281 WebUIController* controller = new content::WebUIController(web_ui); 281 WebUIController* controller = new content::WebUIController(web_ui);
282 Profile* profile = Profile::FromWebUI(web_ui); 282 Profile* profile = Profile::FromWebUI(web_ui);
283 profile->GetChromeURLDataManager()->AddDataSource( 283 ChromeURLDataManager::AddDataSource(profile, new MockWebUIDataSource());
284 new MockWebUIDataSource());
285 return controller; 284 return controller;
286 } 285 }
287 286
288 private: 287 private:
289 DISALLOW_COPY_AND_ASSIGN(MockWebUIProvider); 288 DISALLOW_COPY_AND_ASSIGN(MockWebUIProvider);
290 }; 289 };
291 290
292 base::LazyInstance<MockWebUIProvider> mock_provider_ = 291 base::LazyInstance<MockWebUIProvider> mock_provider_ =
293 LAZY_INSTANCE_INITIALIZER; 292 LAZY_INSTANCE_INITIALIZER;
294 293
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 // testDone directly and expect pass result. 685 // testDone directly and expect pass result.
687 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { 686 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) {
688 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); 687 ASSERT_TRUE(RunJavascriptAsyncTest("testDone"));
689 } 688 }
690 689
691 // Test that calling testDone during RunJavascriptTest still completes when 690 // Test that calling testDone during RunJavascriptTest still completes when
692 // waiting for async result. 691 // waiting for async result.
693 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { 692 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) {
694 ASSERT_TRUE(RunJavascriptTest("testDone")); 693 ASSERT_TRUE(RunJavascriptTest("testDone"));
695 } 694 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/uber/uber_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698