| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015, Google Inc. All rights reserved. | 2 * Copyright (c) 2015, 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "platform/weborigin/KURL.h" | 49 #include "platform/weborigin/KURL.h" |
| 50 #include "public/platform/WebAddressSpace.h" | 50 #include "public/platform/WebAddressSpace.h" |
| 51 #include "public/platform/WebCachePolicy.h" | 51 #include "public/platform/WebCachePolicy.h" |
| 52 #include "public/platform/WebDocumentSubresourceFilter.h" | 52 #include "public/platform/WebDocumentSubresourceFilter.h" |
| 53 #include "public/platform/WebInsecureRequestPolicy.h" | 53 #include "public/platform/WebInsecureRequestPolicy.h" |
| 54 #include "testing/gmock/include/gmock/gmock.h" | 54 #include "testing/gmock/include/gmock/gmock.h" |
| 55 #include "testing/gtest/include/gtest/gtest.h" | 55 #include "testing/gtest/include/gtest/gtest.h" |
| 56 | 56 |
| 57 namespace blink { | 57 namespace blink { |
| 58 | 58 |
| 59 class StubFrameLoaderClientWithParent final : public EmptyFrameLoaderClient { | 59 class StubFrameLoaderClientWithParent final : public EmptyLocalFrameClient { |
| 60 public: | 60 public: |
| 61 static StubFrameLoaderClientWithParent* create(Frame* parent) { | 61 static StubFrameLoaderClientWithParent* create(Frame* parent) { |
| 62 return new StubFrameLoaderClientWithParent(parent); | 62 return new StubFrameLoaderClientWithParent(parent); |
| 63 } | 63 } |
| 64 | 64 |
| 65 DEFINE_INLINE_VIRTUAL_TRACE() { | 65 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 66 visitor->trace(m_parent); | 66 visitor->trace(m_parent); |
| 67 EmptyFrameLoaderClient::trace(visitor); | 67 EmptyLocalFrameClient::trace(visitor); |
| 68 } | 68 } |
| 69 | 69 |
| 70 Frame* parent() const override { return m_parent.get(); } | 70 Frame* parent() const override { return m_parent.get(); } |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 explicit StubFrameLoaderClientWithParent(Frame* parent) : m_parent(parent) {} | 73 explicit StubFrameLoaderClientWithParent(Frame* parent) : m_parent(parent) {} |
| 74 | 74 |
| 75 Member<Frame> m_parent; | 75 Member<Frame> m_parent; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 class MockFrameLoaderClient : public EmptyFrameLoaderClient { | 78 class MockFrameLoaderClient : public EmptyLocalFrameClient { |
| 79 public: | 79 public: |
| 80 MockFrameLoaderClient() : EmptyFrameLoaderClient() {} | 80 MockFrameLoaderClient() : EmptyLocalFrameClient() {} |
| 81 MOCK_METHOD1(didDisplayContentWithCertificateErrors, void(const KURL&)); | 81 MOCK_METHOD1(didDisplayContentWithCertificateErrors, void(const KURL&)); |
| 82 MOCK_METHOD2(dispatchDidLoadResourceFromMemoryCache, | 82 MOCK_METHOD2(dispatchDidLoadResourceFromMemoryCache, |
| 83 void(const ResourceRequest&, const ResourceResponse&)); | 83 void(const ResourceRequest&, const ResourceResponse&)); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class FixedPolicySubresourceFilter : public WebDocumentSubresourceFilter { | 86 class FixedPolicySubresourceFilter : public WebDocumentSubresourceFilter { |
| 87 public: | 87 public: |
| 88 FixedPolicySubresourceFilter(LoadPolicy policy, int* filteredLoadCounter) | 88 FixedPolicySubresourceFilter(LoadPolicy policy, int* filteredLoadCounter) |
| 89 : m_policy(policy), m_filteredLoadCounter(filteredLoadCounter) {} | 89 : m_policy(policy), m_filteredLoadCounter(filteredLoadCounter) {} |
| 90 | 90 |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 setFilterPolicy(WebDocumentSubresourceFilter::WouldDisallow); | 901 setFilterPolicy(WebDocumentSubresourceFilter::WouldDisallow); |
| 902 | 902 |
| 903 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequest()); | 903 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequest()); |
| 904 EXPECT_EQ(0, getFilteredLoadCallCount()); | 904 EXPECT_EQ(0, getFilteredLoadCallCount()); |
| 905 | 905 |
| 906 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequestPreload()); | 906 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequestPreload()); |
| 907 EXPECT_EQ(0, getFilteredLoadCallCount()); | 907 EXPECT_EQ(0, getFilteredLoadCallCount()); |
| 908 } | 908 } |
| 909 | 909 |
| 910 } // namespace blink | 910 } // namespace blink |
| OLD | NEW |