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

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

Issue 12316077: Move the parsing of app.launch related keys out of Extension class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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_validapp_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc
index 75aa59f86ae1c61817163b0ca0a786980e953077..d39d546e0fa7567333351c7336b1c7be9c712876 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc
@@ -2,24 +2,41 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
-
#include "base/values.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/common/extensions/app_launch_manifest_handler.h"
+#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest_handler.h"
+#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
#include "testing/gtest/include/gtest/gtest.h"
-TEST_F(ExtensionManifestTest, ValidApp) {
+class ValidAppManifestTest : public ExtensionManifestTest {
+ virtual void SetUp() OVERRIDE {
Devlin 2013/02/27 19:12:48 while a private: level is default with classes, we
Joe Thomas 2013/03/01 23:26:57 Done.
+ ExtensionManifestTest::SetUp();
+ std::vector<std::string> app_launch_keys(
+ extensions::AppLaunchManifestHandler::keys());
+ linked_ptr<extensions::AppLaunchManifestHandler> app_launch_handler(
+ new extensions::AppLaunchManifestHandler);
+ for (size_t i = 0; i < app_launch_keys.size(); ++i)
Devlin 2013/02/27 19:12:48 Just out of curiosity, is there a reason we don't
Yoyo Zhou 2013/02/27 19:40:32 It's in the works and should land today: https://c
+ extensions::ManifestHandler::Register(app_launch_keys[i],
+ app_launch_handler);
+ }
+};
+
+TEST_F(ValidAppManifestTest, ValidApp) {
scoped_refptr<extensions::Extension> extension(
LoadAndExpectSuccess("valid_app.json"));
extensions::URLPatternSet expected_patterns;
AddPattern(&expected_patterns, "http://www.google.com/mail/*");
AddPattern(&expected_patterns, "http://www.google.com/foobar/*");
EXPECT_EQ(expected_patterns, extension->web_extent());
- EXPECT_EQ(extension_misc::LAUNCH_TAB, extension->launch_container());
- EXPECT_EQ("http://www.google.com/mail/", extension->launch_web_url());
+ EXPECT_EQ(extension_misc::LAUNCH_TAB,
+ extensions::AppLaunchInfo::GetLaunchContainer(extension));
+ EXPECT_EQ("http://www.google.com/mail/",
+ extensions::AppLaunchInfo::GetLaunchWebUrl(extension));
}
-TEST_F(ExtensionManifestTest, AllowUnrecognizedPermissions) {
+TEST_F(ValidAppManifestTest, AllowUnrecognizedPermissions) {
std::string error;
scoped_ptr<DictionaryValue> manifest(LoadManifest("valid_app.json", &error));
ListValue* permissions = NULL;

Powered by Google App Engine
This is Rietveld 408576698