Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: chrome/browser/extensions/webstore_inline_installer_unittest.cc

Issue 384823002: Introduce a stable set of errors for inline install (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace printf with vlog(1) in unrelated code so it passes presubmit Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/test/base/chrome_render_view_host_test_harness.h" 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
9 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 #include "url/gurl.h" 12 #include "url/gurl.h"
12 13
13 namespace extensions { 14 namespace extensions {
14 15
15 namespace { 16 namespace {
16 17
17 // Wraps WebstoreInlineInstaller to provide access to domain verification 18 // Wraps WebstoreInlineInstaller to provide access to domain verification
18 // methods for testing. 19 // methods for testing.
19 class TestWebstoreInlineInstaller : public WebstoreInlineInstaller { 20 class TestWebstoreInlineInstaller : public WebstoreInlineInstaller {
20 public: 21 public:
21 explicit TestWebstoreInlineInstaller(content::WebContents* contents, 22 explicit TestWebstoreInlineInstaller(content::WebContents* contents,
22 const std::string& requestor_url); 23 const std::string& requestor_url);
23 24
24 bool TestCheckRequestorPermitted(const base::DictionaryValue& webstore_data) { 25 bool TestCheckRequestorPermitted(const base::DictionaryValue& webstore_data) {
25 std::string error; 26 std::string error;
26 return CheckRequestorPermitted(webstore_data, &error); 27 return CheckRequestorPermitted(webstore_data, &error);
27 } 28 }
28 29
29 protected: 30 protected:
30 virtual ~TestWebstoreInlineInstaller(); 31 virtual ~TestWebstoreInlineInstaller();
31 }; 32 };
32 33
33 void TestInstallerCallback(bool success, const std::string& error) {} 34 void TestInstallerCallback(bool success,
35 const std::string& error,
36 webstore_install::Result result) {}
34 37
35 TestWebstoreInlineInstaller::TestWebstoreInlineInstaller( 38 TestWebstoreInlineInstaller::TestWebstoreInlineInstaller(
36 content::WebContents* contents, 39 content::WebContents* contents,
37 const std::string& requestor_url) 40 const std::string& requestor_url)
38 : WebstoreInlineInstaller(contents, 41 : WebstoreInlineInstaller(contents,
39 "", 42 "",
40 GURL(requestor_url), 43 GURL(requestor_url),
41 base::Bind(&TestInstallerCallback)) { 44 base::Bind(&TestInstallerCallback)) {
42 } 45 }
43 46
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 verified_sites)); 218 verified_sites));
216 219
217 EXPECT_FALSE(TestMultipleVerifiedSites("http://baz.example.com", 220 EXPECT_FALSE(TestMultipleVerifiedSites("http://baz.example.com",
218 verified_sites)); 221 verified_sites));
219 222
220 EXPECT_FALSE(TestMultipleVerifiedSites("http://bar.example.com:456", 223 EXPECT_FALSE(TestMultipleVerifiedSites("http://bar.example.com:456",
221 verified_sites)); 224 verified_sites));
222 } 225 }
223 226
224 } // namespace extensions 227 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698