OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/api/storage/storage_schema_manifest_handler.h
" | 5 #include "chrome/common/extensions/api/storage/storage_schema_manifest_handler.h
" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/common/chrome_version_info.h" | 14 #include "chrome/common/chrome_version_info.h" |
15 #include "chrome/common/extensions/features/feature_channel.h" | 15 #include "chrome/common/extensions/features/feature_channel.h" |
16 #include "extensions/common/extension.h" | 16 #include "extensions/common/extension.h" |
17 #include "extensions/common/file_util.h" | 17 #include "extensions/common/file_util.h" |
18 #include "extensions/common/manifest.h" | 18 #include "extensions/common/manifest.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 namespace extensions { | 21 namespace extensions { |
22 | 22 |
23 class StorageSchemaManifestHandlerTest : public testing::Test { | 23 class StorageSchemaManifestHandlerTest : public testing::Test { |
24 public: | 24 public: |
25 StorageSchemaManifestHandlerTest() | 25 StorageSchemaManifestHandlerTest() |
26 : scoped_channel_(chrome::VersionInfo::CHANNEL_DEV) {} | 26 : scoped_channel_(chrome::VersionInfo::CHANNEL_DEV) {} |
27 | 27 |
28 virtual ~StorageSchemaManifestHandlerTest() {} | 28 virtual ~StorageSchemaManifestHandlerTest() {} |
29 | 29 |
30 virtual void SetUp() OVERRIDE { | 30 virtual void SetUp() override { |
31 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 31 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
32 | 32 |
33 manifest_.SetString("name", "test"); | 33 manifest_.SetString("name", "test"); |
34 manifest_.SetString("version", "1.2.3.4"); | 34 manifest_.SetString("version", "1.2.3.4"); |
35 manifest_.SetInteger("manifest_version", 2); | 35 manifest_.SetInteger("manifest_version", 2); |
36 } | 36 } |
37 | 37 |
38 scoped_refptr<Extension> CreateExtension(const std::string& schema) { | 38 scoped_refptr<Extension> CreateExtension(const std::string& schema) { |
39 std::string error; | 39 std::string error; |
40 scoped_refptr<Extension> extension = Extension::Create( | 40 scoped_refptr<Extension> extension = Extension::Create( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 // All good now. | 141 // All good now. |
142 EXPECT_TRUE(Validates( | 142 EXPECT_TRUE(Validates( |
143 "{" | 143 "{" |
144 " \"$schema\": \"http://json-schema.org/draft-03/schema#\"," | 144 " \"$schema\": \"http://json-schema.org/draft-03/schema#\"," |
145 " \"type\": \"object\"" | 145 " \"type\": \"object\"" |
146 "}")); | 146 "}")); |
147 } | 147 } |
148 | 148 |
149 } // namespace extensions | 149 } // namespace extensions |
OLD | NEW |