| 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/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" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Produce test output. | 51 // Produce test output. |
| 52 scoped_ptr<DictionaryValue> actual_output_data( | 52 scoped_ptr<DictionaryValue> actual_output_data( |
| 53 ExtensionsDOMHandler::CreateExtensionDetailValue(&extension, pages, | 53 ExtensionsDOMHandler::CreateExtensionDetailValue(&extension, pages, |
| 54 true)); | 54 true)); |
| 55 | 55 |
| 56 // Compare the outputs. | 56 // Compare the outputs. |
| 57 return expected_output_data->Equals(actual_output_data.get()); | 57 return expected_output_data->Equals(actual_output_data.get()); |
| 58 } | 58 } |
| 59 } // namespace | 59 } // namespace |
| 60 | 60 |
| 61 class ExtensionUITest : public testing::Test { | |
| 62 }; | |
| 63 | |
| 64 TEST(ExtensionUITest, GenerateExtensionsJSONData) { | 61 TEST(ExtensionUITest, GenerateExtensionsJSONData) { |
| 65 FilePath data_test_dir_path, extension_path, expected_output_path; | 62 FilePath data_test_dir_path, extension_path, expected_output_path; |
| 66 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_test_dir_path)); | 63 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_test_dir_path)); |
| 67 | 64 |
| 68 // Test Extension1 | 65 // Test Extension1 |
| 69 extension_path = data_test_dir_path.AppendASCII("extensions") | 66 extension_path = data_test_dir_path.AppendASCII("extensions") |
| 70 .AppendASCII("good") | 67 .AppendASCII("good") |
| 71 .AppendASCII("Extensions") | 68 .AppendASCII("Extensions") |
| 72 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") | 69 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
| 73 .AppendASCII("1.0.0.0"); | 70 .AppendASCII("1.0.0.0"); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 expected_output_path = data_test_dir_path.AppendASCII("extensions") | 113 expected_output_path = data_test_dir_path.AppendASCII("extensions") |
| 117 .AppendASCII("ui") | 114 .AppendASCII("ui") |
| 118 .AppendASCII("create_extension_detail_value_expected_output") | 115 .AppendASCII("create_extension_detail_value_expected_output") |
| 119 .AppendASCII("good-extension3.json"); | 116 .AppendASCII("good-extension3.json"); |
| 120 | 117 |
| 121 pages.clear(); | 118 pages.clear(); |
| 122 | 119 |
| 123 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages, | 120 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages, |
| 124 expected_output_path)) << extension_path.value(); | 121 expected_output_path)) << extension_path.value(); |
| 125 } | 122 } |
| OLD | NEW |