OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "platform/weborigin/OriginAccessEntry.h" | 32 #include "platform/weborigin/OriginAccessEntry.h" |
33 | 33 |
34 #include "platform/weborigin/KURL.h" | 34 #include "platform/weborigin/KURL.h" |
35 #include "platform/weborigin/SecurityOrigin.h" | 35 #include "platform/weborigin/SecurityOrigin.h" |
36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
37 #include "public/platform/WebPublicSuffixList.h" | 37 #include "public/platform/WebPublicSuffixList.h" |
38 #include <gtest/gtest.h> | 38 #include <gtest/gtest.h> |
39 | 39 |
40 using WebCore::SecurityOrigin; | 40 using blink::SecurityOrigin; |
41 using WebCore::OriginAccessEntry; | 41 using blink::OriginAccessEntry; |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 class OriginAccessEntryTestSuffixList : public blink::WebPublicSuffixList { | 45 class OriginAccessEntryTestSuffixList : public blink::WebPublicSuffixList { |
46 public: | 46 public: |
47 virtual size_t getPublicSuffixLength(const blink::WebString&) | 47 virtual size_t getPublicSuffixLength(const blink::WebString&) |
48 { | 48 { |
49 return 3; // e.g. "com" | 49 return 3; // e.g. "com" |
50 } | 50 } |
51 }; | 51 }; |
(...skipping 23 matching lines...) Expand all Loading... |
75 OriginAccessEntry entry3("http", "com", OriginAccessEntry::AllowSubdomains,
OriginAccessEntry::TreatIPAddressAsIPAddress); | 75 OriginAccessEntry entry3("http", "com", OriginAccessEntry::AllowSubdomains,
OriginAccessEntry::TreatIPAddressAsIPAddress); |
76 EXPECT_EQ(OriginAccessEntry::MatchesOrigin, entry1.matchesOrigin(*origin)); | 76 EXPECT_EQ(OriginAccessEntry::MatchesOrigin, entry1.matchesOrigin(*origin)); |
77 EXPECT_EQ(OriginAccessEntry::DoesNotMatchOrigin, entry2.matchesOrigin(*origi
n)); | 77 EXPECT_EQ(OriginAccessEntry::DoesNotMatchOrigin, entry2.matchesOrigin(*origi
n)); |
78 EXPECT_EQ(OriginAccessEntry::MatchesOriginButIsPublicSuffix, entry3.matchesO
rigin(*origin)); | 78 EXPECT_EQ(OriginAccessEntry::MatchesOriginButIsPublicSuffix, entry3.matchesO
rigin(*origin)); |
79 | 79 |
80 blink::Platform::shutdown(); | 80 blink::Platform::shutdown(); |
81 } | 81 } |
82 | 82 |
83 } // namespace | 83 } // namespace |
84 | 84 |
OLD | NEW |