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

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: Remove the special case for disabling external cache for kiosk mode. Created 5 years, 4 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
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..44a21f0c1b17916b58cd0125500cce4090c62811
--- /dev/null
+++ b/extensions/common/manifest_handlers/kiosk_mode_info_unittest.cc
@@ -0,0 +1,34 @@
+// 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.
+// 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::vector<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(expected_ids.begin(), expected_ids.end(), parsed_ids.begin()));
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698