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 "base/json/json_file_value_serializer.h" | 5 #include "base/json/json_file_value_serializer.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/api/developer_private/extension_info_generat
or.h" | 9 #include "chrome/browser/extensions/api/developer_private/extension_info_generat
or.h" |
10 #include "chrome/browser/extensions/api/developer_private/inspectable_views_find
er.h" | 10 #include "chrome/browser/extensions/api/developer_private/inspectable_views_find
er.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace developer = api::developer_private; | 30 namespace developer = api::developer_private; |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 const char kAllHostsPermission[] = "*://*/*"; | 34 const char kAllHostsPermission[] = "*://*/*"; |
35 | 35 |
36 scoped_ptr<base::DictionaryValue> DeserializeJSONTestData( | 36 scoped_ptr<base::DictionaryValue> DeserializeJSONTestData( |
37 const base::FilePath& path, | 37 const base::FilePath& path, |
38 std::string *error) { | 38 std::string *error) { |
39 base::Value* value = nullptr; | |
40 JSONFileValueDeserializer deserializer(path); | 39 JSONFileValueDeserializer deserializer(path); |
41 value = deserializer.Deserialize(nullptr, error); | 40 return base::DictionaryValue::From(deserializer.Deserialize(nullptr, error)); |
42 return make_scoped_ptr(static_cast<base::DictionaryValue*>(value)); | |
43 } | 41 } |
44 | 42 |
45 } // namespace | 43 } // namespace |
46 | 44 |
47 class ExtensionInfoGeneratorUnitTest : public ExtensionServiceTestBase { | 45 class ExtensionInfoGeneratorUnitTest : public ExtensionServiceTestBase { |
48 public: | 46 public: |
49 ExtensionInfoGeneratorUnitTest() {} | 47 ExtensionInfoGeneratorUnitTest() {} |
50 ~ExtensionInfoGeneratorUnitTest() override {} | 48 ~ExtensionInfoGeneratorUnitTest() override {} |
51 | 49 |
52 protected: | 50 protected: |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 "all_urls_II", ListBuilder().Append(kAllHostsPermission).Pass()); | 395 "all_urls_II", ListBuilder().Append(kAllHostsPermission).Pass()); |
398 | 396 |
399 // Even though the extension has all_urls permission, the checkbox shouldn't | 397 // Even though the extension has all_urls permission, the checkbox shouldn't |
400 // show up without the switch. | 398 // show up without the switch. |
401 info = GenerateExtensionInfo(all_urls_extension->id()); | 399 info = GenerateExtensionInfo(all_urls_extension->id()); |
402 EXPECT_FALSE(info->run_on_all_urls.is_enabled); | 400 EXPECT_FALSE(info->run_on_all_urls.is_enabled); |
403 EXPECT_TRUE(info->run_on_all_urls.is_active); | 401 EXPECT_TRUE(info->run_on_all_urls.is_active); |
404 } | 402 } |
405 | 403 |
406 } // namespace extensions | 404 } // namespace extensions |
OLD | NEW |