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

Side by Side Diff: chrome/browser/extensions/api/declarative/declarative_apitest.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 (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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 RulesRegistryService::kDefaultRulesRegistryID, 116 RulesRegistryService::kDefaultRulesRegistryID,
117 extensions::declarative_webrequest_constants::kOnRequest); 117 extensions::declarative_webrequest_constants::kOnRequest);
118 118
119 std::vector<linked_ptr<api::events::Rule>> rules; 119 std::vector<linked_ptr<api::events::Rule>> rules;
120 BrowserThread::PostTask( 120 BrowserThread::PostTask(
121 BrowserThread::IO, 121 BrowserThread::IO,
122 FROM_HERE, 122 FROM_HERE,
123 base::Bind( 123 base::Bind(
124 &RulesRegistry::GetAllRules, rules_registry, extension_id, &rules)); 124 &RulesRegistry::GetAllRules, rules_registry, extension_id, &rules));
125 scoped_refptr<base::ThreadTestHelper> io_helper(new base::ThreadTestHelper( 125 scoped_refptr<base::ThreadTestHelper> io_helper(new base::ThreadTestHelper(
126 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); 126 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get()));
127 EXPECT_TRUE(io_helper->Run()); 127 EXPECT_TRUE(io_helper->Run());
128 return rules.size(); 128 return rules.size();
129 } 129 }
130 }; 130 };
131 131
132 IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, DeclarativeApi) { 132 IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, DeclarativeApi) {
133 ASSERT_TRUE(RunExtensionTest("declarative/api")) << message_; 133 ASSERT_TRUE(RunExtensionTest("declarative/api")) << message_;
134 134
135 // Check that uninstalling the extension has removed all rules. 135 // Check that uninstalling the extension has removed all rules.
136 std::string extension_id = GetSingleLoadedExtension()->id(); 136 std::string extension_id = GetSingleLoadedExtension()->id();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 // 2. Uninstall the extension. Rules are gone and preferences should be empty. 250 // 2. Uninstall the extension. Rules are gone and preferences should be empty.
251 UninstallExtension(extension_id); 251 UninstallExtension(extension_id);
252 ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl)); 252 ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl));
253 EXPECT_NE(kTestTitle, GetTitle()); 253 EXPECT_NE(kTestTitle, GetTitle());
254 EXPECT_EQ(0u, NumberOfRegisteredRules(extension_id)); 254 EXPECT_EQ(0u, NumberOfRegisteredRules(extension_id));
255 EXPECT_FALSE(extension_prefs->HasPrefForExtension(extension_id)); 255 EXPECT_FALSE(extension_prefs->HasPrefForExtension(extension_id));
256 } 256 }
257 257
258 } // namespace extensions 258 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/engagement/site_engagement_service.cc ('k') | chrome/browser/extensions/api/dial/dial_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698