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 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ |
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ | 6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
11 #include "chrome/common/extensions/extension_manifest_constants.h" | 11 #include "chrome/common/extensions/extension_manifest_constants.h" |
12 #include "chrome/common/extensions/features/feature.h" | 12 #include "chrome/common/extensions/features/feature.h" |
13 #include "chrome/common/extensions/manifest.h" | 13 #include "chrome/common/extensions/manifest.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 class ExtensionManifestTest : public testing::Test { | 16 class ExtensionManifestTest : public testing::Test { |
17 public: | 17 public: |
18 ExtensionManifestTest(); | 18 ExtensionManifestTest(); |
19 | 19 |
20 protected: | 20 protected: |
21 virtual void SetUp() OVERRIDE; | 21 virtual void TearDown() OVERRIDE; |
22 | 22 |
23 // If filename is a relative path, LoadManifestFile will treat it relative to | 23 // If filename is a relative path, LoadManifestFile will treat it relative to |
24 // the appropriate test directory. | 24 // the appropriate test directory. |
25 static DictionaryValue* LoadManifestFile(const std::string& filename, | 25 static DictionaryValue* LoadManifestFile(const std::string& filename, |
26 std::string* error); | 26 std::string* error); |
27 | 27 |
28 // Helper class that simplifies creating methods that take either a filename | 28 // Helper class that simplifies creating methods that take either a filename |
29 // to a manifest or the manifest itself. | 29 // to a manifest or the manifest itself. |
30 class Manifest { | 30 class Manifest { |
31 public: | 31 public: |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Force the manifest tests to run as though they are on trunk, since several | 141 // Force the manifest tests to run as though they are on trunk, since several |
142 // tests rely on manifest features being available that aren't on | 142 // tests rely on manifest features being available that aren't on |
143 // stable/beta. | 143 // stable/beta. |
144 // | 144 // |
145 // These objects nest, so if a test wants to explicitly test the behaviour | 145 // These objects nest, so if a test wants to explicitly test the behaviour |
146 // on stable or beta, declare it inside that test. | 146 // on stable or beta, declare it inside that test. |
147 extensions::Feature::ScopedCurrentChannel current_channel_; | 147 extensions::Feature::ScopedCurrentChannel current_channel_; |
148 }; | 148 }; |
149 | 149 |
150 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ | 150 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ |
OLD | NEW |