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

Side by Side Diff: extensions/common/url_pattern_set_unittest.cc

Issue 396033002: Support "always allow" for runtime script execution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test changes Created 6 years, 4 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
« no previous file with comments | « extensions/common/url_pattern_set.cc ('k') | extensions/common/url_pattern_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "extensions/common/url_pattern_set.h" 5 #include "extensions/common/url_pattern_set.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 AddPattern(&expected, yahoo_a); 414 AddPattern(&expected, yahoo_a);
415 AddPattern(&expected, yahoo_b); 415 AddPattern(&expected, yahoo_b);
416 AddPattern(&expected, yahoo_c); 416 AddPattern(&expected, yahoo_c);
417 AddPattern(&expected, reddit_a); 417 AddPattern(&expected, reddit_a);
418 AddPattern(&expected, reddit_b); 418 AddPattern(&expected, reddit_b);
419 AddPattern(&expected, reddit_c); 419 AddPattern(&expected, reddit_c);
420 EXPECT_EQ(expected, result); 420 EXPECT_EQ(expected, result);
421 } 421 }
422 } 422 }
423 423
424 TEST(URLPatternSetTest, AddOrigin) {
425 URLPatternSet set;
426 set.AddOrigin(URLPattern::SCHEME_ALL, GURL("https://www.google.com/"));
not at google - send to devlin 2014/08/14 23:04:48 Huh, I would have thought ToOrigin of google.com/
427 EXPECT_TRUE(set.MatchesURL(GURL("https://www.google.com/foo/bar")));
428 EXPECT_FALSE(set.MatchesURL(GURL("http://www.google.com/foo/bar")));
429 EXPECT_FALSE(set.MatchesURL(GURL("https://en.google.com/foo/bar")));
430 set.ClearPatterns();
431
432 set.AddOrigin(URLPattern::SCHEME_ALL, GURL("http://en.foo.com/"));
not at google - send to devlin 2014/08/14 23:04:48 there's no difference between this and the google.
gpdavis 2014/08/14 23:31:33 Sure, I can do that.
433 EXPECT_TRUE(set.MatchesURL(GURL("http://en.foo.com/bar")));
434 EXPECT_FALSE(set.MatchesURL(GURL("https://www.foo.com/")));
435 EXPECT_FALSE(set.MatchesURL(GURL("http://www.foo.com/")));
436 }
437
424 } // namespace extensions 438 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/url_pattern_set.cc ('k') | extensions/common/url_pattern_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698