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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc

Issue 11312228: Move extension_error_utils.* and url_pattern_set.* into (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hate Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 TEST_F(ExtensionManifestTest, ValidApp) { 11 TEST_F(ExtensionManifestTest, ValidApp) {
12 scoped_refptr<extensions::Extension> extension( 12 scoped_refptr<extensions::Extension> extension(
13 LoadAndExpectSuccess("valid_app.json")); 13 LoadAndExpectSuccess("valid_app.json"));
14 URLPatternSet expected_patterns; 14 extensions::URLPatternSet expected_patterns;
15 AddPattern(&expected_patterns, "http://www.google.com/mail/*"); 15 AddPattern(&expected_patterns, "http://www.google.com/mail/*");
16 AddPattern(&expected_patterns, "http://www.google.com/foobar/*"); 16 AddPattern(&expected_patterns, "http://www.google.com/foobar/*");
17 EXPECT_EQ(expected_patterns, extension->web_extent()); 17 EXPECT_EQ(expected_patterns, extension->web_extent());
18 EXPECT_EQ(extension_misc::LAUNCH_TAB, extension->launch_container()); 18 EXPECT_EQ(extension_misc::LAUNCH_TAB, extension->launch_container());
19 EXPECT_EQ("http://www.google.com/mail/", extension->launch_web_url()); 19 EXPECT_EQ("http://www.google.com/mail/", extension->launch_web_url());
20 } 20 }
21 21
22 TEST_F(ExtensionManifestTest, AllowUnrecognizedPermissions) { 22 TEST_F(ExtensionManifestTest, AllowUnrecognizedPermissions) {
23 std::string error; 23 std::string error;
24 scoped_ptr<DictionaryValue> manifest( 24 scoped_ptr<DictionaryValue> manifest(
25 LoadManifestFile("valid_app.json", &error)); 25 LoadManifestFile("valid_app.json", &error));
26 ListValue* permissions = NULL; 26 ListValue* permissions = NULL;
27 ASSERT_TRUE(manifest->GetList("permissions", &permissions)); 27 ASSERT_TRUE(manifest->GetList("permissions", &permissions));
28 permissions->Append(new StringValue("not-a-valid-permission")); 28 permissions->Append(new StringValue("not-a-valid-permission"));
29 LoadAndExpectSuccess(Manifest(manifest.get(), "")); 29 LoadAndExpectSuccess(Manifest(manifest.get(), ""));
30 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698