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

Unified Diff: chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc

Issue 489753002: Added proper extension manifest parser for launcher_page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..33a7a84b4d395e89ec9aa93afd61fca62e8501c4
--- /dev/null
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc
@@ -0,0 +1,38 @@
+// Copyright 2014 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 "base/command_line.h"
+#include "base/memory/linked_ptr.h"
calamity 2014/08/21 02:53:08 I think you can remove this.
Matt Giuca 2014/08/22 02:48:40 Done.
+#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
+#include "extensions/common/constants.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/manifest_constants.h"
+#include "extensions/common/manifest_handlers/launcher_page_info.h"
+#include "extensions/common/switches.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace extensions {
+
+namespace {
+
+// The ID of test manifests requiring whitelisting.
+const char kWhitelistID[] = "lmadimbbgapmngbiclpjjngmdickadpl";
+
+} // namespace
+
+class LauncherPageManifestTest : public ExtensionManifestTest {};
calamity 2014/08/21 02:53:08 I've seen typedef around more often. Any reason no
Matt Giuca 2014/08/22 02:48:40 Done.
+
+TEST_F(LauncherPageManifestTest, ValidLauncherPage) {
+ CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ extensions::switches::kWhitelistedExtensionID, kWhitelistID);
+ scoped_refptr<extensions::Extension> extension(
+ LoadAndExpectSuccess("init_valid_launcher_page.json"));
+ extensions::LauncherPageInfo* info =
+ static_cast<extensions::LauncherPageInfo*>(
+ extension->GetManifestData(extensions::manifest_keys::kLauncherPage));
+ ASSERT_TRUE(info);
+ EXPECT_EQ("test.html", info->page);
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698