OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 7285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7296 WebCachePolicy GetCachePolicy() const { return policy_; } | 7296 WebCachePolicy GetCachePolicy() const { return policy_; } |
7297 int WillSendRequestCallCount() const { return will_send_request_call_count_; } | 7297 int WillSendRequestCallCount() const { return will_send_request_call_count_; } |
7298 int ChildFrameCreationCount() const { return child_frame_creation_count_; } | 7298 int ChildFrameCreationCount() const { return child_frame_creation_count_; } |
7299 | 7299 |
7300 WebLocalFrame* CreateChildFrame( | 7300 WebLocalFrame* CreateChildFrame( |
7301 WebLocalFrame* parent, | 7301 WebLocalFrame* parent, |
7302 WebTreeScopeType scope, | 7302 WebTreeScopeType scope, |
7303 const WebString&, | 7303 const WebString&, |
7304 const WebString&, | 7304 const WebString&, |
7305 WebSandboxFlags, | 7305 WebSandboxFlags, |
| 7306 const WebParsedFeaturePolicy&, |
7306 const WebFrameOwnerProperties& frame_owner_properties) override { | 7307 const WebFrameOwnerProperties& frame_owner_properties) override { |
7307 DCHECK(child_client_); | 7308 DCHECK(child_client_); |
7308 child_frame_creation_count_++; | 7309 child_frame_creation_count_++; |
7309 WebLocalFrame* frame = | 7310 WebLocalFrame* frame = |
7310 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr); | 7311 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr); |
7311 parent->AppendChild(frame); | 7312 parent->AppendChild(frame); |
7312 return frame; | 7313 return frame; |
7313 } | 7314 } |
7314 | 7315 |
7315 virtual void DidStartLoading(bool to_different_document) { | 7316 virtual void DidStartLoading(bool to_different_document) { |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7706 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient { | 7707 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient { |
7707 public: | 7708 public: |
7708 FailCreateChildFrame() : call_count_(0) {} | 7709 FailCreateChildFrame() : call_count_(0) {} |
7709 | 7710 |
7710 WebLocalFrame* CreateChildFrame( | 7711 WebLocalFrame* CreateChildFrame( |
7711 WebLocalFrame* parent, | 7712 WebLocalFrame* parent, |
7712 WebTreeScopeType scope, | 7713 WebTreeScopeType scope, |
7713 const WebString& name, | 7714 const WebString& name, |
7714 const WebString& fallback_name, | 7715 const WebString& fallback_name, |
7715 WebSandboxFlags sandbox_flags, | 7716 WebSandboxFlags sandbox_flags, |
| 7717 const WebParsedFeaturePolicy& container_policy, |
7716 const WebFrameOwnerProperties& frame_owner_properties) override { | 7718 const WebFrameOwnerProperties& frame_owner_properties) override { |
7717 ++call_count_; | 7719 ++call_count_; |
7718 return nullptr; | 7720 return nullptr; |
7719 } | 7721 } |
7720 | 7722 |
7721 int CallCount() const { return call_count_; } | 7723 int CallCount() const { return call_count_; } |
7722 | 7724 |
7723 private: | 7725 private: |
7724 int call_count_; | 7726 int call_count_; |
7725 }; | 7727 }; |
(...skipping 4016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11742 | 11744 |
11743 private: | 11745 private: |
11744 bool did_call_frame_detached_ = false; | 11746 bool did_call_frame_detached_ = false; |
11745 bool did_call_did_stop_loading_ = false; | 11747 bool did_call_did_stop_loading_ = false; |
11746 bool did_call_did_finish_document_load_ = false; | 11748 bool did_call_did_finish_document_load_ = false; |
11747 bool did_call_did_handle_onload_events_ = false; | 11749 bool did_call_did_handle_onload_events_ = false; |
11748 }; | 11750 }; |
11749 | 11751 |
11750 class MainFrameClient : public FrameTestHelpers::TestWebFrameClient { | 11752 class MainFrameClient : public FrameTestHelpers::TestWebFrameClient { |
11751 public: | 11753 public: |
11752 WebLocalFrame* CreateChildFrame(WebLocalFrame* parent, | 11754 WebLocalFrame* CreateChildFrame( |
11753 WebTreeScopeType scope, | 11755 WebLocalFrame* parent, |
11754 const WebString& name, | 11756 WebTreeScopeType scope, |
11755 const WebString& fallback_name, | 11757 const WebString& name, |
11756 WebSandboxFlags sandbox_flags, | 11758 const WebString& fallback_name, |
11757 const WebFrameOwnerProperties&) override { | 11759 WebSandboxFlags sandbox_flags, |
| 11760 const WebParsedFeaturePolicy& container_policy, |
| 11761 const WebFrameOwnerProperties&) override { |
11758 WebLocalFrame* frame = | 11762 WebLocalFrame* frame = |
11759 WebLocalFrame::Create(scope, &child_client_, nullptr, nullptr); | 11763 WebLocalFrame::Create(scope, &child_client_, nullptr, nullptr); |
11760 parent->AppendChild(frame); | 11764 parent->AppendChild(frame); |
11761 return frame; | 11765 return frame; |
11762 } | 11766 } |
11763 | 11767 |
11764 LoadingObserverFrameClient& ChildClient() { return child_client_; } | 11768 LoadingObserverFrameClient& ChildClient() { return child_client_; } |
11765 | 11769 |
11766 private: | 11770 private: |
11767 LoadingObserverFrameClient child_client_; | 11771 LoadingObserverFrameClient child_client_; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11949 void SetChildWebFrameClient(TestFallbackWebFrameClient* client) { | 11953 void SetChildWebFrameClient(TestFallbackWebFrameClient* client) { |
11950 child_client_ = client; | 11954 child_client_ = client; |
11951 } | 11955 } |
11952 | 11956 |
11953 WebLocalFrame* CreateChildFrame( | 11957 WebLocalFrame* CreateChildFrame( |
11954 WebLocalFrame* parent, | 11958 WebLocalFrame* parent, |
11955 WebTreeScopeType scope, | 11959 WebTreeScopeType scope, |
11956 const WebString&, | 11960 const WebString&, |
11957 const WebString&, | 11961 const WebString&, |
11958 WebSandboxFlags, | 11962 WebSandboxFlags, |
| 11963 const WebParsedFeaturePolicy& container_policy, |
11959 const WebFrameOwnerProperties& frameOwnerProperties) override { | 11964 const WebFrameOwnerProperties& frameOwnerProperties) override { |
11960 DCHECK(child_client_); | 11965 DCHECK(child_client_); |
11961 WebLocalFrame* frame = | 11966 WebLocalFrame* frame = |
11962 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr); | 11967 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr); |
11963 parent->AppendChild(frame); | 11968 parent->AppendChild(frame); |
11964 return frame; | 11969 return frame; |
11965 } | 11970 } |
11966 | 11971 |
11967 WebNavigationPolicy DecidePolicyForNavigation( | 11972 WebNavigationPolicy DecidePolicyForNavigation( |
11968 const NavigationPolicyInfo& info) override { | 11973 const NavigationPolicyInfo& info) override { |
(...skipping 30 matching lines...) Expand all Loading... |
11999 | 12004 |
12000 // Failing the original child frame navigation and trying to render fallback | 12005 // Failing the original child frame navigation and trying to render fallback |
12001 // content shouldn't crash. It should return NoLoadInProgress. This is so the | 12006 // content shouldn't crash. It should return NoLoadInProgress. This is so the |
12002 // caller won't attempt to replace the correctly empty frame with an error | 12007 // caller won't attempt to replace the correctly empty frame with an error |
12003 // page. | 12008 // page. |
12004 EXPECT_EQ(WebLocalFrame::NoLoadInProgress, | 12009 EXPECT_EQ(WebLocalFrame::NoLoadInProgress, |
12005 child->MaybeRenderFallbackContent(WebURLError())); | 12010 child->MaybeRenderFallbackContent(WebURLError())); |
12006 } | 12011 } |
12007 | 12012 |
12008 } // namespace blink | 12013 } // namespace blink |
OLD | NEW |