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

Unified Diff: chrome/browser/extensions/plugin_apitest.cc

Issue 709813004: Remove the deprecated function ExtensionService::extensions(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed thestig@'s comments. Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/plugin_apitest.cc
diff --git a/chrome/browser/extensions/plugin_apitest.cc b/chrome/browser/extensions/plugin_apitest.cc
index cfd825f29aa8ca0a348ae06ca10e6b5e18948765..f129958720a113dcedde15fbc989ca7ee0cba372 100644
--- a/chrome/browser/extensions/plugin_apitest.cc
+++ b/chrome/browser/extensions/plugin_apitest.cc
@@ -18,6 +18,7 @@
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
+#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
#include "net/base/filename_util.h"
@@ -63,11 +64,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) {
ExtensionService* service = extensions::ExtensionSystem::Get(
browser()->profile())->extension_service();
+ extensions::ExtensionRegistry* registry =
+ extensions::ExtensionRegistry::Get(browser()->profile());
service->set_show_extensions_prompts(false);
- const size_t size_before = service->extensions()->size();
+ const size_t size_before = registry->enabled_extensions().size();
const Extension* extension = LoadExtension(extension_dir);
ASSERT_TRUE(extension);
- EXPECT_EQ(size_before + 1, service->extensions()->size());
+ EXPECT_EQ(size_before + 1, registry->enabled_extensions().size());
// Now the plugin should be in the cache.
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
tab, "testPluginWorks()", &result));
@@ -78,9 +81,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) {
EXPECT_TRUE(result);
#endif
- EXPECT_EQ(size_before + 1, service->extensions()->size());
+ EXPECT_EQ(size_before + 1, registry->enabled_extensions().size());
UnloadExtension(extension->id());
- EXPECT_EQ(size_before, service->extensions()->size());
+ EXPECT_EQ(size_before, registry->enabled_extensions().size());
// Now the plugin should be unloaded, and the page should be broken.
@@ -91,7 +94,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) {
// If we reload the extension and page, it should work again.
ASSERT_TRUE(LoadExtension(extension_dir));
- EXPECT_EQ(size_before + 1, service->extensions()->size());
+ EXPECT_EQ(size_before + 1, registry->enabled_extensions().size());
{
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
@@ -143,11 +146,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginPrivate) {
ExtensionService* service = extensions::ExtensionSystem::Get(
browser()->profile())->extension_service();
+ extensions::ExtensionRegistry* registry =
+ extensions::ExtensionRegistry::Get(browser()->profile());
service->set_show_extensions_prompts(false);
- const size_t size_before = service->extensions()->size();
+ const size_t size_before = registry->enabled_extensions().size();
const Extension* extension = LoadExtension(extension_dir);
ASSERT_TRUE(extension);
- EXPECT_EQ(size_before + 1, service->extensions()->size());
+ EXPECT_EQ(size_before + 1, registry->enabled_extensions().size());
// Load the test page through the extension URL, and the plugin should work.
ui_test_utils::NavigateToURL(browser(),
« no previous file with comments | « chrome/browser/extensions/page_action_browsertest.cc ('k') | chrome/browser/extensions/test_extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698