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

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

Issue 1497193002: Remove all the ephemeral apps code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests Created 5 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <vector>
6
7 #include "chrome/browser/apps/ephemeral_app_browsertest.h"
8 #include "chrome/browser/apps/ephemeral_app_service.h"
9 #include "extensions/browser/extension_registry.h"
10
11 using extensions::Extension;
12 using extensions::ExtensionRegistry;
13
14 class EphemeralAppServiceBrowserTest : public EphemeralAppTestBase {};
15
16 // Verify that the cache of ephemeral apps is correctly cleared. All ephemeral
17 // apps should be removed.
18 IN_PROC_BROWSER_TEST_F(EphemeralAppServiceBrowserTest, ClearCachedApps) {
19 const Extension* running_app =
20 InstallAndLaunchEphemeralApp(kMessagingReceiverApp);
21 const Extension* inactive_app =
22 InstallAndLaunchEphemeralApp(kDispatchEventTestApp);
23 std::string inactive_app_id = inactive_app->id();
24 std::string running_app_id = running_app->id();
25 CloseAppWaitForUnload(inactive_app_id);
26
27 EphemeralAppService* ephemeral_service =
28 EphemeralAppService::Get(browser()->profile());
29 ASSERT_TRUE(ephemeral_service);
30
31 ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
32 ASSERT_TRUE(registry);
33
34 int extension_count = registry->GenerateInstalledExtensionsSet()->size();
35
36 ephemeral_service->ClearCachedApps();
37
38 EXPECT_FALSE(registry->GetExtensionById(inactive_app_id,
39 ExtensionRegistry::EVERYTHING));
40 EXPECT_FALSE(registry->GetExtensionById(running_app_id,
41 ExtensionRegistry::EVERYTHING));
42
43 int new_extension_count = registry->GenerateInstalledExtensionsSet()->size();
44 EXPECT_EQ(2, extension_count - new_extension_count);
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698