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

Side by Side Diff: chrome/browser/background/background_mode_manager_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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/background/background_mode_manager.h" 9 #include "chrome/browser/background/background_mode_manager.h"
10 #include "chrome/browser/browser_shutdown.h" 10 #include "chrome/browser/browser_shutdown.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 protected: 266 protected:
267 scoped_ptr<SimpleTestBackgroundModeManager> manager_; 267 scoped_ptr<SimpleTestBackgroundModeManager> manager_;
268 268
269 void AddEphemeralApp(const extensions::Extension* extension, 269 void AddEphemeralApp(const extensions::Extension* extension,
270 ExtensionService* service) { 270 ExtensionService* service) {
271 extensions::ExtensionPrefs* prefs = 271 extensions::ExtensionPrefs* prefs =
272 extensions::ExtensionPrefs::Get(service->profile()); 272 extensions::ExtensionPrefs::Get(service->profile());
273 ASSERT_TRUE(prefs); 273 ASSERT_TRUE(prefs);
274 prefs->OnExtensionInstalled(extension, 274 prefs->OnExtensionInstalled(extension,
275 extensions::Extension::ENABLED, 275 extensions::Extension::ENABLED,
276 extensions::Extension::DISABLE_NONE,
276 syncer::StringOrdinal(), 277 syncer::StringOrdinal(),
277 extensions::kInstallFlagIsEphemeral, 278 extensions::kInstallFlagIsEphemeral,
278 std::string()); 279 std::string());
279 280
280 service->AddExtension(extension); 281 service->AddExtension(extension);
281 } 282 }
282 283
283 private: 284 private:
284 // Required for extension service. 285 // Required for extension service.
285 content::TestBrowserThreadBundle thread_bundle_; 286 content::TestBrowserThreadBundle thread_bundle_;
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 // Installing an ephemeral app should not show the balloon. 876 // Installing an ephemeral app should not show the balloon.
876 manager_->SetHasShownBalloon(false); 877 manager_->SetHasShownBalloon(false);
877 AddEphemeralApp(ephemeral_app.get(), service); 878 AddEphemeralApp(ephemeral_app.get(), service);
878 EXPECT_FALSE(manager_->HasShownBalloon()); 879 EXPECT_FALSE(manager_->HasShownBalloon());
879 880
880 // Promoting the ephemeral app to a regular installed app should now show 881 // Promoting the ephemeral app to a regular installed app should now show
881 // the balloon. 882 // the balloon.
882 service->PromoteEphemeralApp(ephemeral_app.get(), false /*from sync*/); 883 service->PromoteEphemeralApp(ephemeral_app.get(), false /*from sync*/);
883 EXPECT_TRUE(manager_->HasShownBalloon()); 884 EXPECT_TRUE(manager_->HasShownBalloon());
884 } 885 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698