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

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

Issue 838903002: Replicate sandbox flags for OOPIF (Blink part 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@iframe-sandbox-flags-part1
Patch Set: Simplify the plumbing by making HTMLFrameOwnerElement::sandboxFlags() public Created 5 years, 11 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 5695 matching lines...) Expand 10 before | Expand all | Expand 10 after
5706 , m_willSendRequestCallCount(0) 5706 , m_willSendRequestCallCount(0)
5707 , m_childFrameCreationCount(0) 5707 , m_childFrameCreationCount(0)
5708 { 5708 {
5709 } 5709 }
5710 5710
5711 void setChildWebFrameClient(TestCachePolicyWebFrameClient* client) { m_child Client = client; } 5711 void setChildWebFrameClient(TestCachePolicyWebFrameClient* client) { m_child Client = client; }
5712 WebURLRequest::CachePolicy cachePolicy() const { return m_policy; } 5712 WebURLRequest::CachePolicy cachePolicy() const { return m_policy; }
5713 int willSendRequestCallCount() const { return m_willSendRequestCallCount; } 5713 int willSendRequestCallCount() const { return m_willSendRequestCallCount; }
5714 int childFrameCreationCount() const { return m_childFrameCreationCount; } 5714 int childFrameCreationCount() const { return m_childFrameCreationCount; }
5715 5715
5716 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString&) 5716 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString&, WebSandboxFlags)
5717 { 5717 {
5718 ASSERT(m_childClient); 5718 ASSERT(m_childClient);
5719 m_childFrameCreationCount++; 5719 m_childFrameCreationCount++;
5720 WebFrame* frame = WebLocalFrame::create(m_childClient); 5720 WebFrame* frame = WebLocalFrame::create(m_childClient);
5721 parent->appendChild(frame); 5721 parent->appendChild(frame);
5722 return frame; 5722 return frame;
5723 } 5723 }
5724 5724
5725 virtual void didStartLoading(bool toDifferentDocument) 5725 virtual void didStartLoading(bool toDifferentDocument)
5726 { 5726 {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
6077 // After commit, there is. 6077 // After commit, there is.
6078 HistoryItem* item = mainFrameLoader.currentItem(); 6078 HistoryItem* item = mainFrameLoader.currentItem();
6079 ASSERT_TRUE(item); 6079 ASSERT_TRUE(item);
6080 EXPECT_EQ(WTF::String(url.data()), item->urlString()); 6080 EXPECT_EQ(WTF::String(url.data()), item->urlString());
6081 } 6081 }
6082 6082
6083 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient { 6083 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient {
6084 public: 6084 public:
6085 FailCreateChildFrame() : m_callCount(0) { } 6085 FailCreateChildFrame() : m_callCount(0) { }
6086 6086
6087 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) override 6087 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName, WebSandboxFlags sandboxFlags) override
6088 { 6088 {
6089 ++m_callCount; 6089 ++m_callCount;
6090 return 0; 6090 return 0;
6091 } 6091 }
6092 6092
6093 int callCount() const { return m_callCount; } 6093 int callCount() const { return m_callCount; }
6094 6094
6095 private: 6095 private:
6096 int m_callCount; 6096 int m_callCount;
6097 }; 6097 };
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
7011 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 7011 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
7012 7012
7013 // Neither should a page reload. 7013 // Neither should a page reload.
7014 localFrame->reload(); 7014 localFrame->reload();
7015 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 7015 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
7016 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 7016 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
7017 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 7017 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
7018 } 7018 }
7019 7019
7020 } // namespace 7020 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698