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

Unified Diff: extensions/common/manifest_handlers/kiosk_mode_info_unittest.cc

Issue 1301323005: Implement kiosk multiple apps feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/manifest_handlers/kiosk_mode_info.cc ('k') | extensions/extensions_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_handlers/kiosk_mode_info_unittest.cc
diff --git a/extensions/common/manifest_handlers/kiosk_mode_info_unittest.cc b/extensions/common/manifest_handlers/kiosk_mode_info_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9e42c1899d2560245d621b2dfac29b4eb5e30815
--- /dev/null
+++ b/extensions/common/manifest_handlers/kiosk_mode_info_unittest.cc
@@ -0,0 +1,35 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "extensions/common/manifest_constants.h"
+#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
+#include "extensions/common/manifest_test.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace extensions {
+
+using KioskModeInfoManifestTest = ManifestTest;
+
+TEST_F(KioskModeInfoManifestTest, NoSecondaryApps) {
+ scoped_refptr<Extension> extension(
+ LoadAndExpectSuccess("kiosk_secondary_app_no_secondary_app.json"));
+ EXPECT_FALSE(KioskModeInfo::HasSecondaryApps(extension.get()));
+}
+
+TEST_F(KioskModeInfoManifestTest, MultipleSecondaryApps) {
+ const std::string expected_ids[] = {
+ "fiehokkcgaojmbhfhlpiheggjhaedjoc",
+ "ihplaomghjbeafnpnjkhppmfpnmdihgd"};
+ scoped_refptr<Extension> extension(
+ LoadAndExpectSuccess("kiosk_secondary_app_multi_apps.json"));
+ EXPECT_TRUE(KioskModeInfo::HasSecondaryApps(extension.get()));
+ KioskModeInfo* info = KioskModeInfo::Get(extension.get());
+ EXPECT_NE(nullptr, info);
+ std::vector<std::string> parsed_ids(info->secondary_app_ids);
+ std::sort(parsed_ids.begin(), parsed_ids.end());
+ EXPECT_TRUE(
+ std::equal(parsed_ids.begin(), parsed_ids.end(), expected_ids));
+}
+
+} // namespace extensions
« no previous file with comments | « extensions/common/manifest_handlers/kiosk_mode_info.cc ('k') | extensions/extensions_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698