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/chrome_manifest_test.h" | 5 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" |
6 | 6 |
7 #include "extensions/common/manifest_constants.h" | 7 #include "extensions/common/manifest_constants.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 bool expect_error; | 30 bool expect_error; |
31 } test_data[] = { | 31 } test_data[] = { |
32 { "require_modern_with_default", true, manifest1.get(), true }, | 32 { "require_modern_with_default", true, manifest1.get(), true }, |
33 { "require_modern_with_v1", true, manifest2.get(), true }, | 33 { "require_modern_with_v1", true, manifest2.get(), true }, |
34 { "require_modern_with_v2", true, manifest3.get(), false }, | 34 { "require_modern_with_v2", true, manifest3.get(), false }, |
35 { "dont_require_modern_with_default", false, manifest1.get(), false }, | 35 { "dont_require_modern_with_default", false, manifest1.get(), false }, |
36 { "dont_require_modern_with_v1", false, manifest2.get(), false }, | 36 { "dont_require_modern_with_v1", false, manifest2.get(), false }, |
37 { "dont_require_modern_with_v2", false, manifest3.get(), false }, | 37 { "dont_require_modern_with_v2", false, manifest3.get(), false }, |
38 }; | 38 }; |
39 | 39 |
40 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); ++i) { | 40 for (size_t i = 0; i < arraysize(test_data); ++i) { |
41 int create_flags = Extension::NO_FLAGS; | 41 int create_flags = Extension::NO_FLAGS; |
42 if (test_data[i].require_modern_manifest_version) | 42 if (test_data[i].require_modern_manifest_version) |
43 create_flags |= Extension::REQUIRE_MODERN_MANIFEST_VERSION; | 43 create_flags |= Extension::REQUIRE_MODERN_MANIFEST_VERSION; |
44 if (test_data[i].expect_error) { | 44 if (test_data[i].expect_error) { |
45 LoadAndExpectError( | 45 LoadAndExpectError( |
46 ManifestData(test_data[i].manifest, | 46 ManifestData(test_data[i].manifest, |
47 test_data[i].test_name), | 47 test_data[i].test_name), |
48 errors::kInvalidManifestVersionOld, | 48 errors::kInvalidManifestVersionOld, |
49 extensions::Manifest::UNPACKED, | 49 extensions::Manifest::UNPACKED, |
50 create_flags); | 50 create_flags); |
51 } else { | 51 } else { |
52 LoadAndExpectSuccess(ManifestData(test_data[i].manifest, | 52 LoadAndExpectSuccess(ManifestData(test_data[i].manifest, |
53 test_data[i].test_name), | 53 test_data[i].test_name), |
54 extensions::Manifest::UNPACKED, | 54 extensions::Manifest::UNPACKED, |
55 create_flags); | 55 create_flags); |
56 } | 56 } |
57 } | 57 } |
58 } | 58 } |
OLD | NEW |