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

Side by Side Diff: extensions/common/manifest_handlers/kiosk_secondary_apps_info_unittest.cc

Issue 1301323005: Implement kiosk multiple apps feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 3 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
(Empty)
1 // Copyright (c) 2015 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 "extensions/common/manifest_constants.h"
6 #include "extensions/common/manifest_handlers/kiosk_secondary_apps_info.h"
7 #include "extensions/common/manifest_test.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace extensions {
11
12 using KioskSecondaryAppsInfoManifestTest = ManifestTest;
13
14 TEST_F(KioskSecondaryAppsInfoManifestTest, NoSecondaryApps) {
15 scoped_refptr<Extension> extension(
16 LoadAndExpectSuccess("kiosk_secondary_app_no_secondary_app.json"));
17 EXPECT_FALSE(KioskSecondaryAppsInfo::HaveSecondaryApps(extension.get()));
18 }
19
20 TEST_F(KioskSecondaryAppsInfoManifestTest, MultipleSecondaryApps) {
21 scoped_refptr<Extension> extension(
22 LoadAndExpectSuccess("kiosk_secondary_app_multi_apps.json"));
23 EXPECT_TRUE(KioskSecondaryAppsInfo::HaveSecondaryApps(extension.get()));
24 KioskSecondaryAppsInfo* info = KioskSecondaryAppsInfo::Get(extension.get());
25 EXPECT_EQ(2u, info->ids.size());
26 const char kSecondaryAppId1[] = "ihplaomghjbeafnpnjkhppmfpnmdihgd";
27 const char kSecondaryAppId2[] = "fiehokkcgaojmbhfhlpiheggjhaedjoc";
28 EXPECT_TRUE(kSecondaryAppId1 == info->ids[0] ||
29 kSecondaryAppId1 == info->ids[1]);
30 EXPECT_TRUE(kSecondaryAppId2 == info->ids[0] ||
31 kSecondaryAppId2 == info->ids[1]);
not at google - send to devlin 2015/08/26 17:53:59 This doesn't test the case where they're the same.
jennyz 2015/08/28 18:24:08 I didn't find the helper function for comparing tw
32 }
33
34 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698