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

Side by Side Diff: extensions/browser/api/web_request/web_request_permissions_unittest.cc

Issue 2489233003: [extensions] Remove unnecessary checks in IsSensitiveURL (Closed)
Patch Set: more DomainIs Created 4 years, 1 month 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "extensions/browser/api/web_request/web_request_permissions.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "url/gurl.h"
9
10 namespace extensions {
11
12 TEST(ExtensionWebRequestPermissions, IsSensitiveURL) {
13 struct TestCase {
14 const char* url;
15 bool is_sensitive;
16 } cases[] = {
17 {"http://www.google.com", false},
18 {"http://www.example.com", false},
19 {"http://clients.google.com", true},
20 {"http://clients4.google.com", true},
21 {"http://clients9999.google.com", true},
22 {"http://clients9999..google.com", false},
23 {"http://clients9999.example.google.com", false},
24 {"http://clients.google.com.", true},
25 {"http://.clients.google.com.", true},
26 {"http://google.example.com", false},
27 {"http://www.example.com", false},
28 {"http://clients.google.com", true},
29 {"http://sb-ssl.google.com", true},
30 {"http://sb-ssl.random.google.com", false},
31 {"http://chrome.google.com", false},
32 {"http://chrome.google.com/webstore", true},
33 {"http://chrome.google.com/webstore?query", true},
34 };
35 for (const TestCase& test : cases) {
36 EXPECT_EQ(test.is_sensitive, IsSensitiveURL(GURL(test.url))) << test.url;
37 }
38 }
39
40 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/web_request_permissions.cc ('k') | extensions/common/extension_urls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698