OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/extension.h" | 7 #include "chrome/browser/extensions/extension.h" |
8 #include "chrome/browser/extensions/extensions_ui.h" | 8 #include "chrome/browser/extensions/extensions_ui.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/json_value_serializer.h" | 10 #include "chrome/common/json_value_serializer.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 FilePath path(FILE_PATH_LITERAL("/foo")); | 32 FilePath path(FILE_PATH_LITERAL("/foo")); |
33 #endif | 33 #endif |
34 Extension extension(path); | 34 Extension extension(path); |
35 std::string error; | 35 std::string error; |
36 | 36 |
37 FilePath manifest_path = extension_path.AppendASCII( | 37 FilePath manifest_path = extension_path.AppendASCII( |
38 Extension::kManifestFilename); | 38 Extension::kManifestFilename); |
39 scoped_ptr<DictionaryValue> extension_data(DeserializeJSONTestData( | 39 scoped_ptr<DictionaryValue> extension_data(DeserializeJSONTestData( |
40 manifest_path, &error)); | 40 manifest_path, &error)); |
41 EXPECT_EQ("", error); | 41 EXPECT_EQ("", error); |
42 EXPECT_TRUE(extension.InitFromValue(*extension_data, true, &error)); | 42 EXPECT_TRUE(extension.InitFromValue(*extension_data, &error)); |
43 EXPECT_EQ("", error); | 43 EXPECT_EQ("", error); |
44 | 44 |
45 scoped_ptr<DictionaryValue>expected_output_data(DeserializeJSONTestData( | 45 scoped_ptr<DictionaryValue>expected_output_data(DeserializeJSONTestData( |
46 expected_output_path, &error)); | 46 expected_output_path, &error)); |
47 EXPECT_EQ("", error); | 47 EXPECT_EQ("", error); |
48 | 48 |
49 // Produce test output. | 49 // Produce test output. |
50 scoped_ptr<DictionaryValue> actual_output_data( | 50 scoped_ptr<DictionaryValue> actual_output_data( |
51 ExtensionsDOMHandler::CreateExtensionDetailValue(&extension)); | 51 ExtensionsDOMHandler::CreateExtensionDetailValue(&extension)); |
52 | 52 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 .AppendASCII("1.0"); | 97 .AppendASCII("1.0"); |
98 | 98 |
99 expected_output_path = data_test_dir_path.AppendASCII("extensions") | 99 expected_output_path = data_test_dir_path.AppendASCII("extensions") |
100 .AppendASCII("ui") | 100 .AppendASCII("ui") |
101 .AppendASCII("create_extension_detail_value_expected_output") | 101 .AppendASCII("create_extension_detail_value_expected_output") |
102 .AppendASCII("good-extension3.json"); | 102 .AppendASCII("good-extension3.json"); |
103 | 103 |
104 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, | 104 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, |
105 expected_output_path)) << extension_path.value(); | 105 expected_output_path)) << extension_path.value(); |
106 } | 106 } |
OLD | NEW |