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

Unified Diff: chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc

Issue 1419823011: app_sorting() calls should go via ExtensionSystem intsead of prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 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/ui/app_list/extension_app_model_builder_unittest.cc
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
index b5aa3535c14ca9e58d59adae395bc079afe9b6cc..f9dbfb8df35250755a017178b7377156ee04f55c 100644
--- a/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
+++ b/chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc
@@ -24,6 +24,7 @@
#include "extensions/browser/app_sorting.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_system.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_set.h"
@@ -31,6 +32,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/app_list/app_list_item.h"
+using extensions::AppSorting;
+using extensions::ExtensionSystem;
+
namespace {
// Get a string of all apps in |model| joined with ','.
@@ -214,8 +218,7 @@ TEST_F(ExtensionAppModelBuilderTest, Reinstall) {
}
TEST_F(ExtensionAppModelBuilderTest, OrdinalPrefsChange) {
- extensions::AppSorting* sorting =
- extensions::ExtensionPrefs::Get(profile_.get())->app_sorting();
+ AppSorting* sorting = ExtensionSystem::Get(profile_.get())->app_sorting();
syncer::StringOrdinal package_app_page =
sorting->GetPageOrdinal(kPackagedApp1Id);
@@ -237,8 +240,7 @@ TEST_F(ExtensionAppModelBuilderTest, OrdinalPrefsChange) {
}
TEST_F(ExtensionAppModelBuilderTest, OnExtensionMoved) {
- extensions::AppSorting* sorting =
- extensions::ExtensionPrefs::Get(profile_.get())->app_sorting();
+ AppSorting* sorting = ExtensionSystem::Get(profile_.get())->app_sorting();
sorting->SetPageOrdinal(kHostedAppId,
sorting->GetPageOrdinal(kPackagedApp1Id));
@@ -260,8 +262,7 @@ TEST_F(ExtensionAppModelBuilderTest, OnExtensionMoved) {
TEST_F(ExtensionAppModelBuilderTest, InvalidOrdinal) {
// Creates a no-ordinal case.
- extensions::AppSorting* sorting =
- extensions::ExtensionPrefs::Get(profile_.get())->app_sorting();
+ AppSorting* sorting = ExtensionSystem::Get(profile_.get())->app_sorting();
sorting->ClearOrdinals(kPackagedApp1Id);
// Creates a corrupted ordinal case.
@@ -281,8 +282,7 @@ TEST_F(ExtensionAppModelBuilderTest, OrdinalConfilicts) {
syncer::StringOrdinal conflict_ordinal =
syncer::StringOrdinal::CreateInitialOrdinal();
- extensions::AppSorting* sorting =
- extensions::ExtensionPrefs::Get(profile_.get())->app_sorting();
+ AppSorting* sorting = ExtensionSystem::Get(profile_.get())->app_sorting();
sorting->SetPageOrdinal(kHostedAppId, conflict_ordinal);
sorting->SetAppLaunchOrdinal(kHostedAppId, conflict_ordinal);
« no previous file with comments | « chrome/browser/ui/app_list/extension_app_item.cc ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698