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/background_info.h" |
6 | |
7 #include "chrome/common/extensions/extension.h" | 6 #include "chrome/common/extensions/extension.h" |
8 #include "chrome/common/extensions/extension_manifest_constants.h" | 7 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 8 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
11 using extensions::Extension; | 11 using extensions::Extension; |
12 | 12 |
13 namespace errors = extension_manifest_errors; | 13 namespace errors = extension_manifest_errors; |
14 | 14 |
15 TEST_F(ExtensionManifestTest, OfflineEnabled) { | 15 namespace extensions { |
| 16 |
| 17 class ExtensionManifestOfflineEnabledTest : public ExtensionManifestTest { |
| 18 virtual void SetUp() OVERRIDE { |
| 19 ExtensionManifestTest::SetUp(); |
| 20 (new BackgroundManifestHandler)->Register(); |
| 21 } |
| 22 }; |
| 23 |
| 24 TEST_F(ExtensionManifestOfflineEnabledTest, OfflineEnabled) { |
16 LoadAndExpectError("offline_enabled_invalid.json", | 25 LoadAndExpectError("offline_enabled_invalid.json", |
17 errors::kInvalidOfflineEnabled); | 26 errors::kInvalidOfflineEnabled); |
18 scoped_refptr<Extension> extension_0( | 27 scoped_refptr<Extension> extension_0( |
19 LoadAndExpectSuccess("offline_enabled_extension.json")); | 28 LoadAndExpectSuccess("offline_enabled_extension.json")); |
20 EXPECT_TRUE(extension_0->offline_enabled()); | 29 EXPECT_TRUE(extension_0->offline_enabled()); |
21 scoped_refptr<Extension> extension_1( | 30 scoped_refptr<Extension> extension_1( |
22 LoadAndExpectSuccess("offline_enabled_packaged_app.json")); | 31 LoadAndExpectSuccess("offline_enabled_packaged_app.json")); |
23 EXPECT_TRUE(extension_1->offline_enabled()); | 32 EXPECT_TRUE(extension_1->offline_enabled()); |
24 scoped_refptr<Extension> extension_2( | 33 scoped_refptr<Extension> extension_2( |
25 LoadAndExpectSuccess("offline_disabled_packaged_app.json")); | 34 LoadAndExpectSuccess("offline_disabled_packaged_app.json")); |
26 EXPECT_FALSE(extension_2->offline_enabled()); | 35 EXPECT_FALSE(extension_2->offline_enabled()); |
27 scoped_refptr<Extension> extension_3( | 36 scoped_refptr<Extension> extension_3( |
28 LoadAndExpectSuccess("offline_default_packaged_app.json")); | 37 LoadAndExpectSuccess("offline_default_packaged_app.json")); |
29 EXPECT_FALSE(extension_3->offline_enabled()); | 38 EXPECT_FALSE(extension_3->offline_enabled()); |
30 scoped_refptr<Extension> extension_4( | 39 scoped_refptr<Extension> extension_4( |
31 LoadAndExpectSuccess("offline_enabled_hosted_app.json")); | 40 LoadAndExpectSuccess("offline_enabled_hosted_app.json")); |
32 EXPECT_TRUE(extension_4->offline_enabled()); | 41 EXPECT_TRUE(extension_4->offline_enabled()); |
33 scoped_refptr<Extension> extension_5( | 42 scoped_refptr<Extension> extension_5( |
34 LoadAndExpectSuccess("offline_default_platform_app.json")); | 43 LoadAndExpectSuccess("offline_default_platform_app.json")); |
35 EXPECT_TRUE(extension_5->offline_enabled()); | 44 EXPECT_TRUE(extension_5->offline_enabled()); |
36 } | 45 } |
| 46 |
| 47 } // namespace extensions |
OLD | NEW |