OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/json/json_file_value_serializer.h" | 6 #include "base/json/json_file_value_serializer.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 profile_.reset(); | 63 profile_.reset(); |
64 // Execute any pending deletion tasks. | 64 // Execute any pending deletion tasks. |
65 message_loop_.RunUntilIdle(); | 65 message_loop_.RunUntilIdle(); |
66 } | 66 } |
67 | 67 |
68 static base::DictionaryValue* DeserializeJSONTestData( | 68 static base::DictionaryValue* DeserializeJSONTestData( |
69 const base::FilePath& path, | 69 const base::FilePath& path, |
70 std::string *error) { | 70 std::string *error) { |
71 base::Value* value; | 71 base::Value* value; |
72 | 72 |
73 JSONFileValueSerializer serializer(path); | 73 JSONFileValueDeserializer deserializer(path); |
74 value = serializer.Deserialize(NULL, error); | 74 value = deserializer.Deserialize(NULL, error); |
75 | 75 |
76 return static_cast<base::DictionaryValue*>(value); | 76 return static_cast<base::DictionaryValue*>(value); |
77 } | 77 } |
78 | 78 |
79 const scoped_refptr<const Extension> CreateExtension( | 79 const scoped_refptr<const Extension> CreateExtension( |
80 const std::string& name, | 80 const std::string& name, |
81 ListBuilder& permissions) { | 81 ListBuilder& permissions) { |
82 const std::string kId = crx_file::id_util::GenerateId(name); | 82 const std::string kId = crx_file::id_util::GenerateId(name); |
83 scoped_refptr<const Extension> extension = | 83 scoped_refptr<const Extension> extension = |
84 ExtensionBuilder().SetManifest( | 84 ExtensionBuilder().SetManifest( |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 // show up without the switch. | 392 // show up without the switch. |
393 value.reset(handler()->CreateExtensionDetailValue( | 393 value.reset(handler()->CreateExtensionDetailValue( |
394 all_urls_extension.get(), std::vector<ExtensionPage>(), NULL)); | 394 all_urls_extension.get(), std::vector<ExtensionPage>(), NULL)); |
395 EXPECT_TRUE(value->GetBoolean(kShowAllUrls, &result)); | 395 EXPECT_TRUE(value->GetBoolean(kShowAllUrls, &result)); |
396 EXPECT_FALSE(result); | 396 EXPECT_FALSE(result); |
397 EXPECT_TRUE(value->GetBoolean(kAllowAllUrls, &result)); | 397 EXPECT_TRUE(value->GetBoolean(kAllowAllUrls, &result)); |
398 EXPECT_TRUE(result); | 398 EXPECT_TRUE(result); |
399 } | 399 } |
400 | 400 |
401 } // namespace extensions | 401 } // namespace extensions |
OLD | NEW |