OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 DictionaryValue manifest; | 26 DictionaryValue manifest; |
27 manifest.SetString("name", name); | 27 manifest.SetString("name", name); |
28 manifest.SetString("version", "1"); | 28 manifest.SetString("version", "1"); |
29 | 29 |
30 if (!launch_url.empty()) | 30 if (!launch_url.empty()) |
31 manifest.SetString("app.launch.web_url", launch_url); | 31 manifest.SetString("app.launch.web_url", launch_url); |
32 | 32 |
33 if (!extent.empty()) { | 33 if (!extent.empty()) { |
34 ListValue* urls = new ListValue(); | 34 ListValue* urls = new ListValue(); |
35 manifest.Set("app.urls", urls); | 35 manifest.Set("app.urls", urls); |
36 urls->Append(Value::CreateStringValue(extent)); | 36 urls->Append(base::StringValue::New(extent)); |
37 } | 37 } |
38 | 38 |
39 std::string error; | 39 std::string error; |
40 scoped_refptr<Extension> extension( | 40 scoped_refptr<Extension> extension( |
41 Extension::Create(path, Extension::INTERNAL, manifest, | 41 Extension::Create(path, Extension::INTERNAL, manifest, |
42 Extension::STRICT_ERROR_CHECKS, &error)); | 42 Extension::STRICT_ERROR_CHECKS, &error)); |
43 EXPECT_TRUE(extension.get()) << error; | 43 EXPECT_TRUE(extension.get()) << error; |
44 return extension; | 44 return extension; |
45 } | 45 } |
46 | 46 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Both of these should be NULL, which mean true for InSameExtent. | 108 // Both of these should be NULL, which mean true for InSameExtent. |
109 EXPECT_TRUE(extensions.InSameExtent( | 109 EXPECT_TRUE(extensions.InSameExtent( |
110 GURL("http://www.google.com/"), | 110 GURL("http://www.google.com/"), |
111 GURL("http://blog.chromium.org/"))); | 111 GURL("http://blog.chromium.org/"))); |
112 | 112 |
113 // Remove one of the extensions. | 113 // Remove one of the extensions. |
114 extensions.Remove(ext2->id()); | 114 extensions.Remove(ext2->id()); |
115 EXPECT_EQ(2u, extensions.size()); | 115 EXPECT_EQ(2u, extensions.size()); |
116 EXPECT_FALSE(extensions.GetByID(ext2->id())); | 116 EXPECT_FALSE(extensions.GetByID(ext2->id())); |
117 } | 117 } |
OLD | NEW |