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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Addressing review comments Created 3 years, 8 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) 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 7284 matching lines...) Expand 10 before | Expand all | Expand 10 after
7295 WebCachePolicy GetCachePolicy() const { return policy_; } 7295 WebCachePolicy GetCachePolicy() const { return policy_; }
7296 int WillSendRequestCallCount() const { return will_send_request_call_count_; } 7296 int WillSendRequestCallCount() const { return will_send_request_call_count_; }
7297 int ChildFrameCreationCount() const { return child_frame_creation_count_; } 7297 int ChildFrameCreationCount() const { return child_frame_creation_count_; }
7298 7298
7299 WebLocalFrame* CreateChildFrame( 7299 WebLocalFrame* CreateChildFrame(
7300 WebLocalFrame* parent, 7300 WebLocalFrame* parent,
7301 WebTreeScopeType scope, 7301 WebTreeScopeType scope,
7302 const WebString&, 7302 const WebString&,
7303 const WebString&, 7303 const WebString&,
7304 WebSandboxFlags, 7304 WebSandboxFlags,
7305 const WebParsedFeaturePolicy&,
7305 const WebFrameOwnerProperties& frame_owner_properties) override { 7306 const WebFrameOwnerProperties& frame_owner_properties) override {
7306 DCHECK(child_client_); 7307 DCHECK(child_client_);
7307 child_frame_creation_count_++; 7308 child_frame_creation_count_++;
7308 WebLocalFrame* frame = 7309 WebLocalFrame* frame =
7309 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr); 7310 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr);
7310 parent->AppendChild(frame); 7311 parent->AppendChild(frame);
7311 return frame; 7312 return frame;
7312 } 7313 }
7313 7314
7314 virtual void DidStartLoading(bool to_different_document) { 7315 virtual void DidStartLoading(bool to_different_document) {
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
7704 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient { 7705 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient {
7705 public: 7706 public:
7706 FailCreateChildFrame() : call_count_(0) {} 7707 FailCreateChildFrame() : call_count_(0) {}
7707 7708
7708 WebLocalFrame* CreateChildFrame( 7709 WebLocalFrame* CreateChildFrame(
7709 WebLocalFrame* parent, 7710 WebLocalFrame* parent,
7710 WebTreeScopeType scope, 7711 WebTreeScopeType scope,
7711 const WebString& name, 7712 const WebString& name,
7712 const WebString& fallback_name, 7713 const WebString& fallback_name,
7713 WebSandboxFlags sandbox_flags, 7714 WebSandboxFlags sandbox_flags,
7715 const WebParsedFeaturePolicy& container_policy,
7714 const WebFrameOwnerProperties& frame_owner_properties) override { 7716 const WebFrameOwnerProperties& frame_owner_properties) override {
7715 ++call_count_; 7717 ++call_count_;
7716 return nullptr; 7718 return nullptr;
7717 } 7719 }
7718 7720
7719 int CallCount() const { return call_count_; } 7721 int CallCount() const { return call_count_; }
7720 7722
7721 private: 7723 private:
7722 int call_count_; 7724 int call_count_;
7723 }; 7725 };
(...skipping 4014 matching lines...) Expand 10 before | Expand all | Expand 10 after
11738 11740
11739 private: 11741 private:
11740 bool did_call_frame_detached_ = false; 11742 bool did_call_frame_detached_ = false;
11741 bool did_call_did_stop_loading_ = false; 11743 bool did_call_did_stop_loading_ = false;
11742 bool did_call_did_finish_document_load_ = false; 11744 bool did_call_did_finish_document_load_ = false;
11743 bool did_call_did_handle_onload_events_ = false; 11745 bool did_call_did_handle_onload_events_ = false;
11744 }; 11746 };
11745 11747
11746 class MainFrameClient : public FrameTestHelpers::TestWebFrameClient { 11748 class MainFrameClient : public FrameTestHelpers::TestWebFrameClient {
11747 public: 11749 public:
11748 WebLocalFrame* CreateChildFrame(WebLocalFrame* parent, 11750 WebLocalFrame* CreateChildFrame(
11749 WebTreeScopeType scope, 11751 WebLocalFrame* parent,
11750 const WebString& name, 11752 WebTreeScopeType scope,
11751 const WebString& fallback_name, 11753 const WebString& name,
11752 WebSandboxFlags sandbox_flags, 11754 const WebString& fallback_name,
11753 const WebFrameOwnerProperties&) override { 11755 WebSandboxFlags sandbox_flags,
11756 const WebParsedFeaturePolicy& container_policy,
11757 const WebFrameOwnerProperties&) override {
11754 WebLocalFrame* frame = 11758 WebLocalFrame* frame =
11755 WebLocalFrame::Create(scope, &child_client_, nullptr, nullptr); 11759 WebLocalFrame::Create(scope, &child_client_, nullptr, nullptr);
11756 parent->AppendChild(frame); 11760 parent->AppendChild(frame);
11757 return frame; 11761 return frame;
11758 } 11762 }
11759 11763
11760 LoadingObserverFrameClient& ChildClient() { return child_client_; } 11764 LoadingObserverFrameClient& ChildClient() { return child_client_; }
11761 11765
11762 private: 11766 private:
11763 LoadingObserverFrameClient child_client_; 11767 LoadingObserverFrameClient child_client_;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
11945 void SetChildWebFrameClient(TestFallbackWebFrameClient* client) { 11949 void SetChildWebFrameClient(TestFallbackWebFrameClient* client) {
11946 child_client_ = client; 11950 child_client_ = client;
11947 } 11951 }
11948 11952
11949 WebLocalFrame* CreateChildFrame( 11953 WebLocalFrame* CreateChildFrame(
11950 WebLocalFrame* parent, 11954 WebLocalFrame* parent,
11951 WebTreeScopeType scope, 11955 WebTreeScopeType scope,
11952 const WebString&, 11956 const WebString&,
11953 const WebString&, 11957 const WebString&,
11954 WebSandboxFlags, 11958 WebSandboxFlags,
11959 const WebParsedFeaturePolicy& container_policy,
11955 const WebFrameOwnerProperties& frameOwnerProperties) override { 11960 const WebFrameOwnerProperties& frameOwnerProperties) override {
11956 DCHECK(child_client_); 11961 DCHECK(child_client_);
11957 WebLocalFrame* frame = 11962 WebLocalFrame* frame =
11958 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr); 11963 WebLocalFrame::Create(scope, child_client_, nullptr, nullptr);
11959 parent->AppendChild(frame); 11964 parent->AppendChild(frame);
11960 return frame; 11965 return frame;
11961 } 11966 }
11962 11967
11963 WebNavigationPolicy DecidePolicyForNavigation( 11968 WebNavigationPolicy DecidePolicyForNavigation(
11964 const NavigationPolicyInfo& info) override { 11969 const NavigationPolicyInfo& info) override {
(...skipping 30 matching lines...) Expand all
11995 12000
11996 // Failing the original child frame navigation and trying to render fallback 12001 // Failing the original child frame navigation and trying to render fallback
11997 // content shouldn't crash. It should return NoLoadInProgress. This is so the 12002 // content shouldn't crash. It should return NoLoadInProgress. This is so the
11998 // caller won't attempt to replace the correctly empty frame with an error 12003 // caller won't attempt to replace the correctly empty frame with an error
11999 // page. 12004 // page.
12000 EXPECT_EQ(WebLocalFrame::NoLoadInProgress, 12005 EXPECT_EQ(WebLocalFrame::NoLoadInProgress,
12001 child->MaybeRenderFallbackContent(WebURLError())); 12006 child->MaybeRenderFallbackContent(WebURLError()));
12002 } 12007 }
12003 12008
12004 } // namespace blink 12009 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698