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

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

Issue 10703142: Move WebstoreInstaller, WebstoreInlineInstaller, related in extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest merge with master for cq Created 8 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
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 "chrome/browser/extensions/webstore_inline_installer.h" 5 #include "chrome/browser/extensions/webstore_inline_installer.h"
6 #include "googleurl/src/gurl.h" 6 #include "googleurl/src/gurl.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace extensions {
10
9 // A macro, so that the IsRequestorURLInVerifiedSite calls are inside of the 11 // A macro, so that the IsRequestorURLInVerifiedSite calls are inside of the
10 // the test, which is marked as a friend of WebstoreInlineInstaller. 12 // the test, which is marked as a friend of WebstoreInlineInstaller.
11 #define IsVerified(requestor_url, verified_site) \ 13 #define IsVerified(requestor_url, verified_site) \
12 WebstoreInlineInstaller::IsRequestorURLInVerifiedSite( \ 14 WebstoreInlineInstaller::IsRequestorURLInVerifiedSite( \
13 GURL(requestor_url), verified_site) 15 GURL(requestor_url), verified_site)
14 16
15 TEST(WebstoreInlineInstallerTest, DomainVerification) { 17 TEST(WebstoreInlineInstallerTest, DomainVerification) {
16 // Exact domain match. 18 // Exact domain match.
17 EXPECT_TRUE(IsVerified("http://example.com", "example.com")); 19 EXPECT_TRUE(IsVerified("http://example.com", "example.com"));
18 20
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 EXPECT_TRUE(IsVerified("http://example.com/path/", "example.com/path")); 64 EXPECT_TRUE(IsVerified("http://example.com/path/", "example.com/path"));
63 65
64 // Path matches (is a file under the path). 66 // Path matches (is a file under the path).
65 EXPECT_TRUE(IsVerified( 67 EXPECT_TRUE(IsVerified(
66 "http://example.com/path/page.html", "example.com/path")); 68 "http://example.com/path/page.html", "example.com/path"));
67 69
68 // Path and port match. 70 // Path and port match.
69 EXPECT_TRUE(IsVerified( 71 EXPECT_TRUE(IsVerified(
70 "http://example.com:123/path/page.html", "example.com:123/path")); 72 "http://example.com:123/path/page.html", "example.com:123/path"));
71 } 73 }
74
75 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer.cc ('k') | chrome/browser/extensions/webstore_install_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698