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

Side by Side Diff: components/search_engines/template_url_fetcher_unittest.cc

Issue 1402553002: Don't use base::MessageLoop::{Quit,QuitClosure} in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 <string> 5 #include <string>
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 add_provider_called_(0), 107 add_provider_called_(0),
108 waiting_for_download_(false) { 108 waiting_for_download_(false) {
109 base::FilePath test_data_dir; 109 base::FilePath test_data_dir;
110 CHECK(GetTestDataDir(&test_data_dir)); 110 CHECK(GetTestDataDir(&test_data_dir));
111 test_server_.ServeFilesFromDirectory(test_data_dir); 111 test_server_.ServeFilesFromDirectory(test_data_dir);
112 } 112 }
113 113
114 void TemplateURLFetcherTest::DestroyedCallback() { 114 void TemplateURLFetcherTest::DestroyedCallback() {
115 callbacks_destroyed_++; 115 callbacks_destroyed_++;
116 if (waiting_for_download_) 116 if (waiting_for_download_)
117 base::MessageLoop::current()->Quit(); 117 base::MessageLoop::current()->QuitWhenIdle();
118 } 118 }
119 119
120 void TemplateURLFetcherTest::ConfirmAddSearchProvider( 120 void TemplateURLFetcherTest::ConfirmAddSearchProvider(
121 base::ScopedClosureRunner* callback_destruction_notifier, 121 base::ScopedClosureRunner* callback_destruction_notifier,
122 scoped_ptr<TemplateURL> template_url) { 122 scoped_ptr<TemplateURL> template_url) {
123 last_callback_template_url_ = template_url.Pass(); 123 last_callback_template_url_ = template_url.Pass();
124 add_provider_called_++; 124 add_provider_called_++;
125 } 125 }
126 126
127 void TemplateURLFetcherTest::StartDownload( 127 void TemplateURLFetcherTest::StartDownload(
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 std::string osdd_file_name("unicode_open_search.xml"); 336 std::string osdd_file_name("unicode_open_search.xml");
337 StartDownload(keyword, osdd_file_name, 337 StartDownload(keyword, osdd_file_name,
338 TemplateURLFetcher::AUTODETECTED_PROVIDER, true); 338 TemplateURLFetcher::AUTODETECTED_PROVIDER, true);
339 WaitForDownloadToFinish(); 339 WaitForDownloadToFinish();
340 const TemplateURL* t_url = 340 const TemplateURL* t_url =
341 test_util()->model()->GetTemplateURLForKeyword(keyword); 341 test_util()->model()->GetTemplateURLForKeyword(keyword);
342 EXPECT_EQ(base::UTF8ToUTF16("\xd1\x82\xd0\xb5\xd1\x81\xd1\x82"), 342 EXPECT_EQ(base::UTF8ToUTF16("\xd1\x82\xd0\xb5\xd1\x81\xd1\x82"),
343 t_url->short_name()); 343 t_url->short_name());
344 } 344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698