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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp

Issue 1802953003: RemoteBridgeFrameOwner: keep better track of the attached frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't call virtuals indirectly from a ctor. Created 4 years, 9 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 /* 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 private: 66 private:
67 explicit StubFrameLoaderClientWithParent(Frame* parent) 67 explicit StubFrameLoaderClientWithParent(Frame* parent)
68 : m_parent(parent) 68 : m_parent(parent)
69 { 69 {
70 } 70 }
71 71
72 RawPtrWillBeMember<Frame> m_parent; 72 RawPtrWillBeMember<Frame> m_parent;
73 }; 73 };
74 74
75 class StubFrameOwner : public NoBaseWillBeGarbageCollectedFinalized<StubFrameOwn er>, public FrameOwner {
76 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StubFrameOwner);
77 public:
78 static PassOwnPtrWillBeRawPtr<StubFrameOwner> create()
79 {
80 return adoptPtrWillBeNoop(new StubFrameOwner);
81 }
82
83 DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); }
84
85 bool isLocal() const override { return false; }
86 SandboxFlags getSandboxFlags() const override { return SandboxNone; }
87 void dispatchLoad() override { }
88 void renderFallbackContent() override { }
89 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; }
90 int marginWidth() const override { return -1; }
91 int marginHeight() const override { return -1; }
92 };
93
94 class MockFrameLoaderClient : public EmptyFrameLoaderClient { 75 class MockFrameLoaderClient : public EmptyFrameLoaderClient {
95 public: 76 public:
96 MockFrameLoaderClient() 77 MockFrameLoaderClient()
97 : EmptyFrameLoaderClient() 78 : EmptyFrameLoaderClient()
98 { 79 {
99 } 80 }
100 MOCK_METHOD4(didDisplayContentWithCertificateErrors, void(const KURL&, const CString&, const WebURL&, const CString&)); 81 MOCK_METHOD4(didDisplayContentWithCertificateErrors, void(const KURL&, const CString&, const WebURL&, const CString&));
101 }; 82 };
102 83
103 class FrameFetchContextTest : public ::testing::Test { 84 class FrameFetchContextTest : public ::testing::Test {
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource ); 709 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource );
729 EXPECT_EQ(mainRequest.isExternalRequest(), test.isExternalExpectation); 710 EXPECT_EQ(mainRequest.isExternalRequest(), test.isExternalExpectation);
730 711
731 ResourceRequest subRequest(test.url); 712 ResourceRequest subRequest(test.url);
732 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); 713 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource);
733 EXPECT_EQ(subRequest.isExternalRequest(), test.isExternalExpectation); 714 EXPECT_EQ(subRequest.isExternalRequest(), test.isExternalExpectation);
734 } 715 }
735 } 716 }
736 717
737 } // namespace blink 718 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698