OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "chrome/browser/extensions/extensions_ui.h" | 7 #include "chrome/browser/extensions/extensions_ui.h" |
8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 #include "chrome/common/json_value_serializer.h" | 10 #include "chrome/common/json_value_serializer.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 23 matching lines...) Expand all Loading... |
35 #endif | 35 #endif |
36 std::string error; | 36 std::string error; |
37 | 37 |
38 FilePath manifest_path = extension_path.Append( | 38 FilePath manifest_path = extension_path.Append( |
39 Extension::kManifestFilename); | 39 Extension::kManifestFilename); |
40 scoped_ptr<DictionaryValue> extension_data(DeserializeJSONTestData( | 40 scoped_ptr<DictionaryValue> extension_data(DeserializeJSONTestData( |
41 manifest_path, &error)); | 41 manifest_path, &error)); |
42 EXPECT_EQ("", error); | 42 EXPECT_EQ("", error); |
43 | 43 |
44 scoped_refptr<Extension> extension(Extension::Create( | 44 scoped_refptr<Extension> extension(Extension::Create( |
45 path, Extension::INVALID, *extension_data, true, true, &error)); | 45 path, Extension::INVALID, *extension_data, |
| 46 Extension::REQUIRE_KEY | Extension::STRICT_ERROR_CHECKS, &error)); |
46 EXPECT_TRUE(extension.get()); | 47 EXPECT_TRUE(extension.get()); |
47 EXPECT_EQ("", error); | 48 EXPECT_EQ("", error); |
48 | 49 |
49 scoped_ptr<DictionaryValue> expected_output_data(DeserializeJSONTestData( | 50 scoped_ptr<DictionaryValue> expected_output_data(DeserializeJSONTestData( |
50 expected_output_path, &error)); | 51 expected_output_path, &error)); |
51 EXPECT_EQ("", error); | 52 EXPECT_EQ("", error); |
52 | 53 |
53 // Produce test output. | 54 // Produce test output. |
54 scoped_ptr<DictionaryValue> actual_output_data( | 55 scoped_ptr<DictionaryValue> actual_output_data( |
55 ExtensionsDOMHandler::CreateExtensionDetailValue(NULL, extension.get(), | 56 ExtensionsDOMHandler::CreateExtensionDetailValue(NULL, extension.get(), |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 expected_output_path = data_test_dir_path.AppendASCII("extensions") | 118 expected_output_path = data_test_dir_path.AppendASCII("extensions") |
118 .AppendASCII("ui") | 119 .AppendASCII("ui") |
119 .AppendASCII("create_extension_detail_value_expected_output") | 120 .AppendASCII("create_extension_detail_value_expected_output") |
120 .AppendASCII("good-extension3.json"); | 121 .AppendASCII("good-extension3.json"); |
121 | 122 |
122 pages.clear(); | 123 pages.clear(); |
123 | 124 |
124 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages, | 125 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages, |
125 expected_output_path)) << extension_path.value(); | 126 expected_output_path)) << extension_path.value(); |
126 } | 127 } |
OLD | NEW |