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

Side by Side Diff: chrome/browser/search_engines/template_url_scraper_unittest.cc

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 #include "chrome/browser/search_engines/template_url_service.h" 6 #include "chrome/browser/search_engines/template_url_service.h"
7 #include "chrome/browser/search_engines/template_url_service_factory.h" 7 #include "chrome/browser/search_engines/template_url_service_factory.h"
8 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" 8 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 13 matching lines...) Expand all
24 private: 24 private:
25 DISALLOW_COPY_AND_ASSIGN(TemplateURLScraperTest); 25 DISALLOW_COPY_AND_ASSIGN(TemplateURLScraperTest);
26 }; 26 };
27 27
28 class TemplateURLServiceLoader : public content::NotificationObserver { 28 class TemplateURLServiceLoader : public content::NotificationObserver {
29 public: 29 public:
30 explicit TemplateURLServiceLoader(TemplateURLService* model) : model_(model) { 30 explicit TemplateURLServiceLoader(TemplateURLService* model) : model_(model) {
31 registrar_.Add(this, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, 31 registrar_.Add(this, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED,
32 content::Source<TemplateURLService>(model)); 32 content::Source<TemplateURLService>(model));
33 model_->Load(); 33 model_->Load();
34 ui_test_utils::RunMessageLoop(); 34 content::RunMessageLoop();
35 } 35 }
36 36
37 virtual void Observe(int type, 37 virtual void Observe(int type,
38 const content::NotificationSource& source, 38 const content::NotificationSource& source,
39 const content::NotificationDetails& details) { 39 const content::NotificationDetails& details) {
40 if (type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED && 40 if (type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED &&
41 content::Source<TemplateURLService>(source).ptr() == model_) { 41 content::Source<TemplateURLService>(source).ptr() == model_) {
42 MessageLoop::current()->Quit(); 42 MessageLoop::current()->Quit();
43 } 43 }
44 } 44 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 HTTPTestServer::CreateServerWithFileRootURL( 79 HTTPTestServer::CreateServerWithFileRootURL(
80 L"chrome/test/data/template_url_scraper/submit_handler", L"/", 80 L"chrome/test/data/template_url_scraper/submit_handler", L"/",
81 g_browser_process->io_thread()->message_loop())); 81 g_browser_process->io_thread()->message_loop()));
82 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( 82 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(
83 browser(), GURL("http://www.foo.com:1337/"), 2); 83 browser(), GURL("http://www.foo.com:1337/"), 2);
84 84
85 all_urls = template_urls->GetTemplateURLs(); 85 all_urls = template_urls->GetTemplateURLs();
86 EXPECT_EQ(1, all_urls.size() - prepopulate_urls.size()); 86 EXPECT_EQ(1, all_urls.size() - prepopulate_urls.size());
87 } 87 }
88 */ 88 */
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | chrome/browser/service/service_process_control_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698