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

Side by Side Diff: chrome/browser/apps/ephemeral_app_launcher_browsertest.cc

Issue 698553002: Split Blacklist from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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
« no previous file with comments | « no previous file | chrome/browser/extensions/blacklist.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/message_loop/message_loop_proxy.h" 5 #include "base/message_loop/message_loop_proxy.h"
6 #include "chrome/browser/apps/ephemeral_app_launcher.h" 6 #include "chrome/browser/apps/ephemeral_app_launcher.h"
7 #include "chrome/browser/apps/ephemeral_app_service.h" 7 #include "chrome/browser/apps/ephemeral_app_service.h"
8 #include "chrome/browser/extensions/extension_install_checker.h" 8 #include "chrome/browser/extensions/extension_install_checker.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/install_tracker.h" 10 #include "chrome/browser/extensions/install_tracker.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 &policy); 448 &policy);
449 449
450 RunLaunchTest(kDefaultAppId, webstore_install::BLOCKED_BY_POLICY, false); 450 RunLaunchTest(kDefaultAppId, webstore_install::BLOCKED_BY_POLICY, false);
451 EXPECT_FALSE(GetInstalledExtension(kDefaultAppId)); 451 EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
452 } 452 }
453 453
454 // Verifies that an app blacklisted for malware is not installed ephemerally. 454 // Verifies that an app blacklisted for malware is not installed ephemerally.
455 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistedForMalware) { 455 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistedForMalware) {
456 // Mock a BLACKLISTED_MALWARE return status. 456 // Mock a BLACKLISTED_MALWARE return status.
457 extensions::TestBlacklist blacklist_tester( 457 extensions::TestBlacklist blacklist_tester(
458 ExtensionSystem::Get(profile())->blacklist()); 458 extensions::Blacklist::Get(profile()));
459 blacklist_tester.SetBlacklistState( 459 blacklist_tester.SetBlacklistState(
460 kDefaultAppId, extensions::BLACKLISTED_MALWARE, false); 460 kDefaultAppId, extensions::BLACKLISTED_MALWARE, false);
461 461
462 RunLaunchTest(kDefaultAppId, webstore_install::BLACKLISTED, false); 462 RunLaunchTest(kDefaultAppId, webstore_install::BLACKLISTED, false);
463 EXPECT_FALSE(GetInstalledExtension(kDefaultAppId)); 463 EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
464 } 464 }
465 465
466 // Verifies that an app with unknown blacklist status is installed ephemerally 466 // Verifies that an app with unknown blacklist status is installed ephemerally
467 // and launched. 467 // and launched.
468 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistStateUnknown) { 468 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistStateUnknown) {
469 // Mock a BLACKLISTED_MALWARE return status. 469 // Mock a BLACKLISTED_MALWARE return status.
470 extensions::TestBlacklist blacklist_tester( 470 extensions::TestBlacklist blacklist_tester(
471 ExtensionSystem::Get(profile())->blacklist()); 471 extensions::Blacklist::Get(profile()));
472 blacklist_tester.SetBlacklistState( 472 blacklist_tester.SetBlacklistState(
473 kDefaultAppId, extensions::BLACKLISTED_UNKNOWN, false); 473 kDefaultAppId, extensions::BLACKLISTED_UNKNOWN, false);
474 474
475 RunLaunchTest(kDefaultAppId, webstore_install::SUCCESS, true); 475 RunLaunchTest(kDefaultAppId, webstore_install::SUCCESS, true);
476 ValidateAppInstalledEphemerally(kDefaultAppId); 476 ValidateAppInstalledEphemerally(kDefaultAppId);
477 } 477 }
478 478
479 // Verifies that an app with unsupported requirements is not installed 479 // Verifies that an app with unsupported requirements is not installed
480 // ephemerally. 480 // ephemerally.
481 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, UnsupportedRequirements) { 481 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, UnsupportedRequirements) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 560 }
561 561
562 // Verifies that a launch will fail if a duplicate launch is in progress. 562 // Verifies that a launch will fail if a duplicate launch is in progress.
563 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) { 563 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) {
564 extensions::ActiveInstallData install_data(kDefaultAppId); 564 extensions::ActiveInstallData install_data(kDefaultAppId);
565 install_data.is_ephemeral = true; 565 install_data.is_ephemeral = true;
566 InstallTracker::Get(profile())->AddActiveInstall(install_data); 566 InstallTracker::Get(profile())->AddActiveInstall(install_data);
567 567
568 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false); 568 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false);
569 } 569 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/blacklist.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698