| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/webstore_inline_installer.h" | 7 #include "chrome/browser/extensions/webstore_inline_installer.h" |
| 8 #include "chrome/common/extensions/webstore_install_result.h" | 8 #include "chrome/common/extensions/webstore_install_result.h" |
| 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Simulates a test against a list of verified site strings from a Webstore | 93 // Simulates a test against a list of verified site strings from a Webstore |
| 94 // item's "verified_sites" manifest entry. | 94 // item's "verified_sites" manifest entry. |
| 95 bool WebstoreInlineInstallerTest::TestMultipleVerifiedSites( | 95 bool WebstoreInlineInstallerTest::TestMultipleVerifiedSites( |
| 96 const std::string& requestor_url, | 96 const std::string& requestor_url, |
| 97 const std::vector<std::string>& verified_sites) { | 97 const std::vector<std::string>& verified_sites) { |
| 98 base::ListValue* sites = new base::ListValue(); | 98 base::ListValue* sites = new base::ListValue(); |
| 99 for (std::vector<std::string>::const_iterator it = verified_sites.begin(); | 99 for (std::vector<std::string>::const_iterator it = verified_sites.begin(); |
| 100 it != verified_sites.end(); ++it) { | 100 it != verified_sites.end(); ++it) { |
| 101 sites->Append(new base::StringValue(*it)); | 101 sites->AppendString(*it); |
| 102 } | 102 } |
| 103 base::DictionaryValue webstore_data; | 103 base::DictionaryValue webstore_data; |
| 104 webstore_data.Set("verified_sites", sites); | 104 webstore_data.Set("verified_sites", sites); |
| 105 | 105 |
| 106 scoped_refptr<TestWebstoreInlineInstaller> installer = | 106 scoped_refptr<TestWebstoreInlineInstaller> installer = |
| 107 new TestWebstoreInlineInstaller(web_contents_.get(), requestor_url); | 107 new TestWebstoreInlineInstaller(web_contents_.get(), requestor_url); |
| 108 return installer->TestCheckRequestorPermitted(webstore_data); | 108 return installer->TestCheckRequestorPermitted(webstore_data); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace | 111 } // namespace |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 verified_sites)); | 219 verified_sites)); |
| 220 | 220 |
| 221 EXPECT_FALSE(TestMultipleVerifiedSites("http://baz.example.com", | 221 EXPECT_FALSE(TestMultipleVerifiedSites("http://baz.example.com", |
| 222 verified_sites)); | 222 verified_sites)); |
| 223 | 223 |
| 224 EXPECT_FALSE(TestMultipleVerifiedSites("http://bar.example.com:456", | 224 EXPECT_FALSE(TestMultipleVerifiedSites("http://bar.example.com:456", |
| 225 verified_sites)); | 225 verified_sites)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace extensions | 228 } // namespace extensions |
| OLD | NEW |