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

Side by Side Diff: extensions/browser/app_window/app_window_geometry_cache_unittest.cc

Issue 1254363004: Move ownership of AppSorting from ExtensionPrefs to ExtensionSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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 "extensions/browser/app_window/app_window_geometry_cache.h" 5 #include "extensions/browser/app_window/app_window_geometry_cache.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/mock_pref_change_callback.h" 9 #include "base/prefs/mock_pref_change_callback.h"
10 #include "base/prefs/pref_service_factory.h" 10 #include "base/prefs/pref_service_factory.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 user_prefs::PrefRegistrySyncable* pref_registry = 88 user_prefs::PrefRegistrySyncable* pref_registry =
89 new user_prefs::PrefRegistrySyncable; 89 new user_prefs::PrefRegistrySyncable;
90 // Prefs should be registered before the PrefService is created. 90 // Prefs should be registered before the PrefService is created.
91 ExtensionPrefs::RegisterProfilePrefs(pref_registry); 91 ExtensionPrefs::RegisterProfilePrefs(pref_registry);
92 pref_service_ = factory.Create(pref_registry).Pass(); 92 pref_service_ = factory.Create(pref_registry).Pass();
93 93
94 extension_prefs_.reset(ExtensionPrefs::Create( 94 extension_prefs_.reset(ExtensionPrefs::Create(
95 pref_service_.get(), 95 pref_service_.get(),
96 browser_context()->GetPath().AppendASCII("Extensions"), 96 browser_context()->GetPath().AppendASCII("Extensions"),
97 extension_pref_value_map_.get(), 97 extension_pref_value_map_.get(),
98 scoped_ptr<AppSorting>(new NullAppSorting),
99 false /* extensions_disabled */, 98 false /* extensions_disabled */,
100 std::vector<ExtensionPrefsObserver*>())); 99 std::vector<ExtensionPrefsObserver*>()));
100 scoped_ptr<AppSorting> app_sorting(new NullAppSorting);
101 extension_prefs_->set_app_sorting(app_sorting.get());
not at google - send to devlin 2015/07/29 18:22:03 ... would making TestExtensionSystem use a NullApp
Marc Treib 2015/07/30 14:04:12 ..and instead have ExtensionPrefs use |ExtensionSy
not at google - send to devlin 2015/07/30 18:21:00 Ah yeah. I saw ExtensionPrefs::Get(BrowserContext*
Marc Treib 2015/07/31 08:17:49 Yes, the problem is just with tests that use an Ex
101 102
102 cache_.reset( 103 cache_.reset(
103 new AppWindowGeometryCache(browser_context(), extension_prefs_.get())); 104 new AppWindowGeometryCache(browser_context(), extension_prefs_.get()));
104 cache_->SetSyncDelayForTests(0); 105 cache_->SetSyncDelayForTests(0);
105 } 106 }
106 107
107 void AppWindowGeometryCacheTest::TearDown() { 108 void AppWindowGeometryCacheTest::TearDown() {
108 cache_.reset(); 109 cache_.reset();
109 extension_prefs_.reset(); 110 extension_prefs_.reset();
110 pref_service_.reset(); 111 pref_service_.reset();
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // The first added window should no longer have cached geometry. 422 // The first added window should no longer have cached geometry.
422 EXPECT_FALSE(cache_->GetGeometry(extension_id, "window_0", NULL, NULL, NULL)); 423 EXPECT_FALSE(cache_->GetGeometry(extension_id, "window_0", NULL, NULL, NULL));
423 // All other windows should still exist. 424 // All other windows should still exist.
424 for (size_t i = 1; i < AppWindowGeometryCache::kMaxCachedWindows + 1; ++i) { 425 for (size_t i = 1; i < AppWindowGeometryCache::kMaxCachedWindows + 1; ++i) {
425 std::string window_id = "window_" + base::IntToString(i); 426 std::string window_id = "window_" + base::IntToString(i);
426 EXPECT_TRUE(cache_->GetGeometry(extension_id, window_id, NULL, NULL, NULL)); 427 EXPECT_TRUE(cache_->GetGeometry(extension_id, window_id, NULL, NULL, NULL));
427 } 428 }
428 } 429 }
429 430
430 } // namespace extensions 431 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698