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

Side by Side Diff: chrome/browser/extensions/extension_gcm_app_handler_unittest.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/extension_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 DISALLOW_COPY_AND_ASSIGN(FakeExtensionGCMAppHandler); 191 DISALLOW_COPY_AND_ASSIGN(FakeExtensionGCMAppHandler);
192 }; 192 };
193 193
194 class ExtensionGCMAppHandlerTest : public testing::Test { 194 class ExtensionGCMAppHandlerTest : public testing::Test {
195 public: 195 public:
196 static std::unique_ptr<KeyedService> BuildGCMProfileService( 196 static std::unique_ptr<KeyedService> BuildGCMProfileService(
197 content::BrowserContext* context) { 197 content::BrowserContext* context) {
198 Profile* profile = Profile::FromBrowserContext(context); 198 Profile* profile = Profile::FromBrowserContext(context);
199 scoped_refptr<base::SequencedTaskRunner> ui_thread = 199 scoped_refptr<base::SequencedTaskRunner> ui_thread =
200 content::BrowserThread::GetMessageLoopProxyForThread( 200 content::BrowserThread::GetTaskRunnerForThread(
201 content::BrowserThread::UI); 201 content::BrowserThread::UI);
202 scoped_refptr<base::SequencedTaskRunner> io_thread = 202 scoped_refptr<base::SequencedTaskRunner> io_thread =
203 content::BrowserThread::GetMessageLoopProxyForThread( 203 content::BrowserThread::GetTaskRunnerForThread(
204 content::BrowserThread::IO); 204 content::BrowserThread::IO);
205 base::SequencedWorkerPool* worker_pool = 205 base::SequencedWorkerPool* worker_pool =
206 content::BrowserThread::GetBlockingPool(); 206 content::BrowserThread::GetBlockingPool();
207 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( 207 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
208 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( 208 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior(
209 worker_pool->GetSequenceToken(), 209 worker_pool->GetSequenceToken(),
210 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); 210 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
211 return base::WrapUnique(new gcm::GCMProfileService( 211 return base::WrapUnique(new gcm::GCMProfileService(
212 profile->GetPrefs(), profile->GetPath(), profile->GetRequestContext(), 212 profile->GetPrefs(), profile->GetPath(), profile->GetRequestContext(),
213 chrome::GetChannel(), 213 chrome::GetChannel(),
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 // App handler is removed when the extension is updated to the version that 486 // App handler is removed when the extension is updated to the version that
487 // has GCM permission removed. 487 // has GCM permission removed.
488 UpdateExtension(extension.get(), "good2.crx"); 488 UpdateExtension(extension.get(), "good2.crx");
489 waiter()->PumpUILoop(); 489 waiter()->PumpUILoop();
490 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); 490 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero());
491 EXPECT_FALSE(HasAppHandlers(extension->id())); 491 EXPECT_FALSE(HasAppHandlers(extension->id()));
492 } 492 }
493 493
494 } // namespace extensions 494 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698