OLD | NEW |
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 "chrome/common/extensions/extension.h" | 7 #include "chrome/common/extensions/extension.h" |
8 #include "chrome/common/extensions/extension_manifest_constants.h" | 8 #include "chrome/common/extensions/extension_manifest_constants.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
| 11 using extensions::Extension; |
| 12 |
11 namespace errors = extension_manifest_errors; | 13 namespace errors = extension_manifest_errors; |
12 | 14 |
13 TEST_F(ExtensionManifestTest, OfflineEnabled) { | 15 TEST_F(ExtensionManifestTest, OfflineEnabled) { |
14 LoadAndExpectError("offline_enabled_invalid.json", | 16 LoadAndExpectError("offline_enabled_invalid.json", |
15 errors::kInvalidOfflineEnabled); | 17 errors::kInvalidOfflineEnabled); |
16 scoped_refptr<Extension> extension_0( | 18 scoped_refptr<Extension> extension_0( |
17 LoadAndExpectSuccess("offline_enabled_extension.json")); | 19 LoadAndExpectSuccess("offline_enabled_extension.json")); |
18 EXPECT_TRUE(extension_0->offline_enabled()); | 20 EXPECT_TRUE(extension_0->offline_enabled()); |
19 scoped_refptr<Extension> extension_1( | 21 scoped_refptr<Extension> extension_1( |
20 LoadAndExpectSuccess("offline_enabled_packaged_app.json")); | 22 LoadAndExpectSuccess("offline_enabled_packaged_app.json")); |
21 EXPECT_TRUE(extension_1->offline_enabled()); | 23 EXPECT_TRUE(extension_1->offline_enabled()); |
22 scoped_refptr<Extension> extension_2( | 24 scoped_refptr<Extension> extension_2( |
23 LoadAndExpectSuccess("offline_disabled_packaged_app.json")); | 25 LoadAndExpectSuccess("offline_disabled_packaged_app.json")); |
24 EXPECT_FALSE(extension_2->offline_enabled()); | 26 EXPECT_FALSE(extension_2->offline_enabled()); |
25 scoped_refptr<Extension> extension_3( | 27 scoped_refptr<Extension> extension_3( |
26 LoadAndExpectSuccess("offline_default_packaged_app.json")); | 28 LoadAndExpectSuccess("offline_default_packaged_app.json")); |
27 EXPECT_FALSE(extension_3->offline_enabled()); | 29 EXPECT_FALSE(extension_3->offline_enabled()); |
28 scoped_refptr<Extension> extension_4( | 30 scoped_refptr<Extension> extension_4( |
29 LoadAndExpectSuccess("offline_enabled_hosted_app.json")); | 31 LoadAndExpectSuccess("offline_enabled_hosted_app.json")); |
30 EXPECT_TRUE(extension_4->offline_enabled()); | 32 EXPECT_TRUE(extension_4->offline_enabled()); |
31 } | 33 } |
OLD | NEW |