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; | 39 scoped_ptr<base::Value> value = nullptr; |
Lei Zhang
2015/10/12 22:42:21
no need to initialize to nullptr.
| |
40 JSONFileValueDeserializer deserializer(path); | 40 JSONFileValueDeserializer deserializer(path); |
41 value = deserializer.Deserialize(nullptr, error); | 41 value = deserializer.Deserialize(nullptr, error); |
42 return make_scoped_ptr(static_cast<base::DictionaryValue*>(value)); | 42 return make_scoped_ptr(static_cast<base::DictionaryValue*>(value.release())); |
43 } | 43 } |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 class ExtensionInfoGeneratorUnitTest : public ExtensionServiceTestBase { | 47 class ExtensionInfoGeneratorUnitTest : public ExtensionServiceTestBase { |
48 public: | 48 public: |
49 ExtensionInfoGeneratorUnitTest() {} | 49 ExtensionInfoGeneratorUnitTest() {} |
50 ~ExtensionInfoGeneratorUnitTest() override {} | 50 ~ExtensionInfoGeneratorUnitTest() override {} |
51 | 51 |
52 protected: | 52 protected: |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 "all_urls_II", ListBuilder().Append(kAllHostsPermission).Pass()); | 397 "all_urls_II", ListBuilder().Append(kAllHostsPermission).Pass()); |
398 | 398 |
399 // Even though the extension has all_urls permission, the checkbox shouldn't | 399 // Even though the extension has all_urls permission, the checkbox shouldn't |
400 // show up without the switch. | 400 // show up without the switch. |
401 info = GenerateExtensionInfo(all_urls_extension->id()); | 401 info = GenerateExtensionInfo(all_urls_extension->id()); |
402 EXPECT_FALSE(info->run_on_all_urls.is_enabled); | 402 EXPECT_FALSE(info->run_on_all_urls.is_enabled); |
403 EXPECT_TRUE(info->run_on_all_urls.is_active); | 403 EXPECT_TRUE(info->run_on_all_urls.is_active); |
404 } | 404 } |
405 | 405 |
406 } // namespace extensions | 406 } // namespace extensions |
OLD | NEW |