Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
|
not at google - send to devlin
2015/09/01 22:51:11
No (c)
jennyz
2015/09/02 21:42:23
Done.
| |
| 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_mode_info.h" | |
| 7 #include "extensions/common/manifest_test.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 | |
| 10 namespace extensions { | |
| 11 | |
| 12 using KioskModeInfoManifestTest = ManifestTest; | |
| 13 | |
| 14 TEST_F(KioskModeInfoManifestTest, NoSecondaryApps) { | |
| 15 scoped_refptr<Extension> extension( | |
| 16 LoadAndExpectSuccess("kiosk_secondary_app_no_secondary_app.json")); | |
| 17 EXPECT_FALSE(KioskModeInfo::HasSecondaryApps(extension.get())); | |
| 18 } | |
| 19 | |
| 20 TEST_F(KioskModeInfoManifestTest, 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(KioskModeInfo::HasSecondaryApps(extension.get())); | |
| 26 KioskModeInfo* info = KioskModeInfo::Get(extension.get()); | |
| 27 EXPECT_NE(nullptr, info); | |
| 28 std::vector<std::string> parsed_ids(info->secondary_app_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 | |
| OLD | NEW |