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

Side by Side Diff: chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc

Issue 714133002: Add more management policy checking after extension installed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix CrOS compile 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.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/values.h" 10 #include "base/values.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 Extension* extension) { 159 Extension* extension) {
160 // Install extension the first time a preference is set for it. 160 // Install extension the first time a preference is set for it.
161 Extension* extensions[] = { extension1(), 161 Extension* extensions[] = { extension1(),
162 extension2(), 162 extension2(),
163 extension3(), 163 extension3(),
164 extension4() }; 164 extension4() };
165 for (size_t i = 0; i < kNumInstalledExtensions; ++i) { 165 for (size_t i = 0; i < kNumInstalledExtensions; ++i) {
166 if (extension == extensions[i] && !installed_[i]) { 166 if (extension == extensions[i] && !installed_[i]) {
167 prefs()->OnExtensionInstalled(extension, 167 prefs()->OnExtensionInstalled(extension,
168 Extension::ENABLED, 168 Extension::ENABLED,
169 Extension::DISABLE_NONE,
169 syncer::StringOrdinal(), 170 syncer::StringOrdinal(),
170 std::string()); 171 std::string());
171 prefs()->SetIsIncognitoEnabled(extension->id(), true); 172 prefs()->SetIsIncognitoEnabled(extension->id(), true);
172 installed_[i] = true; 173 installed_[i] = true;
173 break; 174 break;
174 } 175 }
175 } 176 }
176 } 177 }
177 178
178 void ExtensionControlledPrefsTest::EnsureExtensionUninstalled( 179 void ExtensionControlledPrefsTest::EnsureExtensionUninstalled(
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 EXPECT_EQ(kDefaultPref1, actual); 474 EXPECT_EQ(kDefaultPref1, actual);
474 } 475 }
475 } 476 }
476 477
477 private: 478 private:
478 int iteration_; 479 int iteration_;
479 }; 480 };
480 TEST_F(ControlledPrefsDisableExtensions, ControlledPrefsDisableExtensions) { } 481 TEST_F(ControlledPrefsDisableExtensions, ControlledPrefsDisableExtensions) { }
481 482
482 } // namespace extensions 483 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698