OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 "Expected failure loading extension '" << name << | 69 "Expected failure loading extension '" << name << |
70 "', but didn't get one."; | 70 "', but didn't get one."; |
71 EXPECT_TRUE(MatchPatternASCII(error, expected_error)) << name << | 71 EXPECT_TRUE(MatchPatternASCII(error, expected_error)) << name << |
72 " expected '" << expected_error << "' but got '" << error << "'"; | 72 " expected '" << expected_error << "' but got '" << error << "'"; |
73 } | 73 } |
74 | 74 |
75 bool enable_apps_; | 75 bool enable_apps_; |
76 }; | 76 }; |
77 | 77 |
78 TEST_F(ManifestTest, AppsDisabledByDefault) { | 78 TEST_F(ManifestTest, AppsDisabledByDefault) { |
| 79 #if defined(OS_CHROMEOS) |
| 80 // On ChromeOS, apps are enabled by default. |
| 81 if (Extension::AppsAreEnabled()) |
| 82 return; |
| 83 #endif |
| 84 |
79 enable_apps_ = false; | 85 enable_apps_ = false; |
80 LoadAndExpectError("web_content_disabled.json", errors::kAppsNotEnabled); | 86 LoadAndExpectError("web_content_disabled.json", errors::kAppsNotEnabled); |
81 LoadAndExpectError("launch_local_path.json", errors::kAppsNotEnabled); | 87 LoadAndExpectError("launch_local_path.json", errors::kAppsNotEnabled); |
82 } | 88 } |
83 | 89 |
84 TEST_F(ManifestTest, ValidApp) { | 90 TEST_F(ManifestTest, ValidApp) { |
85 scoped_ptr<Extension> extension(LoadAndExpectSuccess("valid_app.json")); | 91 scoped_ptr<Extension> extension(LoadAndExpectSuccess("valid_app.json")); |
86 EXPECT_TRUE(extension->web_content_enabled()); | 92 EXPECT_TRUE(extension->web_content_enabled()); |
87 EXPECT_EQ(GURL("http://www.google.com/"), extension->web_extent().origin()); | 93 EXPECT_EQ(GURL("http://www.google.com/"), extension->web_extent().origin()); |
88 EXPECT_EQ(2u, extension->web_extent().paths().size()); | 94 EXPECT_EQ(2u, extension->web_extent().paths().size()); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 "permission_chrome_resources_url.json", | 213 "permission_chrome_resources_url.json", |
208 Extension::COMPONENT, | 214 Extension::COMPONENT, |
209 &error)); | 215 &error)); |
210 EXPECT_EQ("", error); | 216 EXPECT_EQ("", error); |
211 } | 217 } |
212 | 218 |
213 TEST_F(ManifestTest, ChromeURLContentScriptInvalid) { | 219 TEST_F(ManifestTest, ChromeURLContentScriptInvalid) { |
214 LoadAndExpectError("content_script_chrome_url_invalid.json", | 220 LoadAndExpectError("content_script_chrome_url_invalid.json", |
215 errors::kInvalidMatch); | 221 errors::kInvalidMatch); |
216 } | 222 } |
OLD | NEW |