| 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 namespace errors = extension_manifest_errors; | |
| 17 namespace keys = extension_manifest_keys; | |
| 18 | |
| 19 class ExtensionManifestTest : public testing::Test { | 16 class ExtensionManifestTest : public testing::Test { |
| 20 public: | 17 public: |
| 21 ExtensionManifestTest(); | 18 ExtensionManifestTest(); |
| 22 | 19 |
| 23 protected: | 20 protected: |
| 21 virtual void SetUp() OVERRIDE; |
| 22 |
| 24 // 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 |
| 25 // the appropriate test directory. | 24 // the appropriate test directory. |
| 26 static DictionaryValue* LoadManifestFile(const std::string& filename, | 25 static DictionaryValue* LoadManifestFile(const std::string& filename, |
| 27 std::string* error); | 26 std::string* error); |
| 28 | 27 |
| 29 // Helper class that simplifies creating methods that take either a filename | 28 // Helper class that simplifies creating methods that take either a filename |
| 30 // to a manifest or the manifest itself. | 29 // to a manifest or the manifest itself. |
| 31 class Manifest { | 30 class Manifest { |
| 32 public: | 31 public: |
| 33 explicit Manifest(const char* name); | 32 explicit Manifest(const char* name); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // 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 |
| 143 // tests rely on manifest features being available that aren't on | 142 // tests rely on manifest features being available that aren't on |
| 144 // stable/beta. | 143 // stable/beta. |
| 145 // | 144 // |
| 146 // 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 |
| 147 // on stable or beta, declare it inside that test. | 146 // on stable or beta, declare it inside that test. |
| 148 extensions::Feature::ScopedCurrentChannel current_channel_; | 147 extensions::Feature::ScopedCurrentChannel current_channel_; |
| 149 }; | 148 }; |
| 150 | 149 |
| 151 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ | 150 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_TESTS_EXTENSION_MANIFEST_TEST_H_ |
| OLD | NEW |