OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 std::string MakeJSONList(const std::string& s0 = "", | 67 std::string MakeJSONList(const std::string& s0 = "", |
68 const std::string& s1 = "", | 68 const std::string& s1 = "", |
69 const std::string& s2 = "") { | 69 const std::string& s2 = "") { |
70 std::vector<std::string> v; | 70 std::vector<std::string> v; |
71 if (!s0.empty()) | 71 if (!s0.empty()) |
72 v.push_back(s0); | 72 v.push_back(s0); |
73 if (!s1.empty()) | 73 if (!s1.empty()) |
74 v.push_back(s1); | 74 v.push_back(s1); |
75 if (!s2.empty()) | 75 if (!s2.empty()) |
76 v.push_back(s2); | 76 v.push_back(s2); |
77 std::string list = JoinString(v, "\",\""); | 77 std::string list = base::JoinString(v, "\",\""); |
78 if (!list.empty()) | 78 if (!list.empty()) |
79 list = "\"" + list + "\""; | 79 list = "\"" + list + "\""; |
80 return "[" + list + "]"; | 80 return "[" + list + "]"; |
81 } | 81 } |
82 | 82 |
83 content::WebContents* web_contents() { | 83 content::WebContents* web_contents() { |
84 return browser()->tab_strip_model()->GetActiveWebContents(); | 84 return browser()->tab_strip_model()->GetActiveWebContents(); |
85 } | 85 } |
86 | 86 |
87 GURL GetTestURLFor(const std::string& host) { | 87 GURL GetTestURLFor(const std::string& host) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // This extension has unlimitedStorage but doesn't grant it to foo.example.com | 229 // This extension has unlimitedStorage but doesn't grant it to foo.example.com |
230 scoped_refptr<const Extension> extension = LoadExtensionWithCapabilities( | 230 scoped_refptr<const Extension> extension = LoadExtensionWithCapabilities( |
231 MakeJSONList("http://foo.example.com/*"), MakeJSONList("clipboardRead"), | 231 MakeJSONList("http://foo.example.com/*"), MakeJSONList("clipboardRead"), |
232 MakeJSONList("unlimitedStorage")); | 232 MakeJSONList("unlimitedStorage")); |
233 | 233 |
234 EXPECT_TRUE( | 234 EXPECT_TRUE( |
235 HasUnlimitedStorage(extension.get(), extension->GetResourceURL(""))); | 235 HasUnlimitedStorage(extension.get(), extension->GetResourceURL(""))); |
236 EXPECT_FALSE( | 236 EXPECT_FALSE( |
237 HasUnlimitedStorage(extension.get(), GetTestURLFor("foo.example.com"))); | 237 HasUnlimitedStorage(extension.get(), GetTestURLFor("foo.example.com"))); |
238 } | 238 } |
OLD | NEW |