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

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

Issue 383703002: Clear the ephemeral app cache from Clear Browsing Data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments for tests Created 6 years, 5 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 "chrome/browser/apps/ephemeral_app_browsertest.h" 5 #include "chrome/browser/apps/ephemeral_app_browsertest.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/saved_files_service.h" 9 #include "apps/saved_files_service.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 using extensions::ExtensionPrefs; 46 using extensions::ExtensionPrefs;
47 using extensions::ExtensionRegistry; 47 using extensions::ExtensionRegistry;
48 using extensions::ExtensionRegistryObserver; 48 using extensions::ExtensionRegistryObserver;
49 using extensions::ExtensionSystem; 49 using extensions::ExtensionSystem;
50 using extensions::Manifest; 50 using extensions::Manifest;
51 51
52 namespace { 52 namespace {
53 53
54 namespace alarms = extensions::api::alarms; 54 namespace alarms = extensions::api::alarms;
55 55
56 const char kDispatchEventTestApp[] = "ephemeral_apps/dispatch_event";
57 const char kNotificationsTestApp[] = "ephemeral_apps/notification_settings"; 56 const char kNotificationsTestApp[] = "ephemeral_apps/notification_settings";
58 const char kFileSystemTestApp[] = "ephemeral_apps/filesystem_retain_entries"; 57 const char kFileSystemTestApp[] = "ephemeral_apps/filesystem_retain_entries";
59 58
60 typedef std::vector<message_center::Notifier*> NotifierList; 59 typedef std::vector<message_center::Notifier*> NotifierList;
61 60
62 bool IsNotifierInList(const message_center::NotifierId& notifier_id, 61 bool IsNotifierInList(const message_center::NotifierId& notifier_id,
63 const NotifierList& notifiers) { 62 const NotifierList& notifiers) {
64 for (NotifierList::const_iterator it = notifiers.begin(); 63 for (NotifierList::const_iterator it = notifiers.begin();
65 it != notifiers.end(); ++it) { 64 it != notifiers.end(); ++it) {
66 const message_center::Notifier* notifier = *it; 65 const message_center::Notifier* notifier = *it;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 115
117 } // namespace 116 } // namespace
118 117
119 118
120 // EphemeralAppTestBase: 119 // EphemeralAppTestBase:
121 120
122 const char EphemeralAppTestBase::kMessagingReceiverApp[] = 121 const char EphemeralAppTestBase::kMessagingReceiverApp[] =
123 "ephemeral_apps/messaging_receiver"; 122 "ephemeral_apps/messaging_receiver";
124 const char EphemeralAppTestBase::kMessagingReceiverAppV2[] = 123 const char EphemeralAppTestBase::kMessagingReceiverAppV2[] =
125 "ephemeral_apps/messaging_receiver2"; 124 "ephemeral_apps/messaging_receiver2";
125 const char EphemeralAppTestBase::kDispatchEventTestApp[] =
126 "ephemeral_apps/dispatch_event";
126 127
127 EphemeralAppTestBase::EphemeralAppTestBase() {} 128 EphemeralAppTestBase::EphemeralAppTestBase() {}
128 129
129 EphemeralAppTestBase::~EphemeralAppTestBase() {} 130 EphemeralAppTestBase::~EphemeralAppTestBase() {}
130 131
131 void EphemeralAppTestBase::SetUpCommandLine(base::CommandLine* command_line) { 132 void EphemeralAppTestBase::SetUpCommandLine(base::CommandLine* command_line) {
132 // Skip PlatformAppBrowserTest, which sets different values for the switches 133 // Skip PlatformAppBrowserTest, which sets different values for the switches
133 // below. 134 // below.
134 ExtensionBrowserTest::SetUpCommandLine(command_line); 135 ExtensionBrowserTest::SetUpCommandLine(command_line);
135 136
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 702
702 // Ensure that when the app is promoted to an installed app, the bit in the 703 // Ensure that when the app is promoted to an installed app, the bit in the
703 // creation flags is cleared. 704 // creation flags is cleared.
704 PromoteEphemeralApp(app); 705 PromoteEphemeralApp(app);
705 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); 706 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile()));
706 707
707 int creation_flags = 708 int creation_flags =
708 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); 709 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id());
709 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); 710 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL);
710 } 711 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698