| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/extensions/api/developer_private/extension_info_generat
or.h" | 5 #include "chrome/browser/extensions/api/developer_private/extension_info_generat
or.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 const base::FilePath& extension_path, | 165 const base::FilePath& extension_path, |
| 166 InspectableViewsFinder::ViewList views, | 166 InspectableViewsFinder::ViewList views, |
| 167 const base::FilePath& expected_output_path) { | 167 const base::FilePath& expected_output_path) { |
| 168 std::string error; | 168 std::string error; |
| 169 std::unique_ptr<base::DictionaryValue> expected_output_data( | 169 std::unique_ptr<base::DictionaryValue> expected_output_data( |
| 170 DeserializeJSONTestData(expected_output_path, &error)); | 170 DeserializeJSONTestData(expected_output_path, &error)); |
| 171 EXPECT_EQ(std::string(), error); | 171 EXPECT_EQ(std::string(), error); |
| 172 | 172 |
| 173 // Produce test output. | 173 // Produce test output. |
| 174 std::unique_ptr<developer::ExtensionInfo> info = | 174 std::unique_ptr<developer::ExtensionInfo> info = |
| 175 CreateExtensionInfoFromPath(extension_path, Manifest::INVALID_LOCATION); | 175 CreateExtensionInfoFromPath(extension_path, Manifest::UNPACKED); |
| 176 info->views = std::move(views); | 176 info->views = std::move(views); |
| 177 std::unique_ptr<base::DictionaryValue> actual_output_data = info->ToValue(); | 177 std::unique_ptr<base::DictionaryValue> actual_output_data = info->ToValue(); |
| 178 ASSERT_TRUE(actual_output_data); | 178 ASSERT_TRUE(actual_output_data); |
| 179 | 179 |
| 180 // Compare the outputs. | 180 // Compare the outputs. |
| 181 // Ignore unknown fields in the actual output data. | 181 // Ignore unknown fields in the actual output data. |
| 182 std::string paths_details = " - expected (" + | 182 std::string paths_details = " - expected (" + |
| 183 expected_output_path.MaybeAsASCII() + ") vs. actual (" + | 183 expected_output_path.MaybeAsASCII() + ") vs. actual (" + |
| 184 extension_path.MaybeAsASCII() + ")"; | 184 extension_path.MaybeAsASCII() + ")"; |
| 185 std::string expected_string; | 185 std::string expected_string; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 info_list = GenerateExtensionsInfo(); | 466 info_list = GenerateExtensionsInfo(); |
| 467 info1 = GetInfoFromList(info_list, id1); | 467 info1 = GetInfoFromList(info_list, id1); |
| 468 info2 = GetInfoFromList(info_list, id2); | 468 info2 = GetInfoFromList(info_list, id2); |
| 469 ASSERT_NE(nullptr, info1); | 469 ASSERT_NE(nullptr, info1); |
| 470 ASSERT_NE(nullptr, info2); | 470 ASSERT_NE(nullptr, info2); |
| 471 EXPECT_EQ(developer::EXTENSION_STATE_BLACKLISTED, info1->state); | 471 EXPECT_EQ(developer::EXTENSION_STATE_BLACKLISTED, info1->state); |
| 472 EXPECT_EQ(developer::EXTENSION_STATE_ENABLED, info2->state); | 472 EXPECT_EQ(developer::EXTENSION_STATE_ENABLED, info2->state); |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace extensions | 475 } // namespace extensions |
| OLD | NEW |