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

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: Fix nits. 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 const std::vector<std::string> expected_ids = {
22 "fiehokkcgaojmbhfhlpiheggjhaedjoc", "ihplaomghjbeafnpnjkhppmfpnmdihgd"};
23 scoped_refptr<Extension> extension(
24 LoadAndExpectSuccess("kiosk_secondary_app_multi_apps.json"));
25 EXPECT_TRUE(KioskSecondaryAppsInfo::HaveSecondaryApps(extension.get()));
26 KioskSecondaryAppsInfo* info = KioskSecondaryAppsInfo::Get(extension.get());
27 EXPECT_NE(nullptr, info);
28 std::vector<std::string> parsed_ids(info->ids);
29 std::sort(parsed_ids.begin(), parsed_ids.end());
30 EXPECT_TRUE(
31 std::equal(expected_ids.begin(), expected_ids.end(), parsed_ids.begin()));
32 }
33
34 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698