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

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: Remove old createLocalChild 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 5690 matching lines...) Expand 10 before | Expand all | Expand 10 after
5701 , m_willSendRequestCallCount(0) 5701 , m_willSendRequestCallCount(0)
5702 , m_childFrameCreationCount(0) 5702 , m_childFrameCreationCount(0)
5703 { 5703 {
5704 } 5704 }
5705 5705
5706 void setChildWebFrameClient(TestCachePolicyWebFrameClient* client) { m_child Client = client; } 5706 void setChildWebFrameClient(TestCachePolicyWebFrameClient* client) { m_child Client = client; }
5707 WebURLRequest::CachePolicy cachePolicy() const { return m_policy; } 5707 WebURLRequest::CachePolicy cachePolicy() const { return m_policy; }
5708 int willSendRequestCallCount() const { return m_willSendRequestCallCount; } 5708 int willSendRequestCallCount() const { return m_willSendRequestCallCount; }
5709 int childFrameCreationCount() const { return m_childFrameCreationCount; } 5709 int childFrameCreationCount() const { return m_childFrameCreationCount; }
5710 5710
5711 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString&) 5711 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString&, WebSandboxFlags)
5712 { 5712 {
5713 ASSERT(m_childClient); 5713 ASSERT(m_childClient);
5714 m_childFrameCreationCount++; 5714 m_childFrameCreationCount++;
5715 WebFrame* frame = WebLocalFrame::create(m_childClient); 5715 WebFrame* frame = WebLocalFrame::create(m_childClient);
5716 parent->appendChild(frame); 5716 parent->appendChild(frame);
5717 return frame; 5717 return frame;
5718 } 5718 }
5719 5719
5720 virtual void didStartLoading(bool toDifferentDocument) 5720 virtual void didStartLoading(bool toDifferentDocument)
5721 { 5721 {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
6072 // After commit, there is. 6072 // After commit, there is.
6073 HistoryItem* item = mainFrameLoader.currentItem(); 6073 HistoryItem* item = mainFrameLoader.currentItem();
6074 ASSERT_TRUE(item); 6074 ASSERT_TRUE(item);
6075 EXPECT_EQ(WTF::String(url.data()), item->urlString()); 6075 EXPECT_EQ(WTF::String(url.data()), item->urlString());
6076 } 6076 }
6077 6077
6078 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient { 6078 class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient {
6079 public: 6079 public:
6080 FailCreateChildFrame() : m_callCount(0) { } 6080 FailCreateChildFrame() : m_callCount(0) { }
6081 6081
6082 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName) override 6082 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f rameName, WebSandboxFlags sandboxFlags) override
6083 { 6083 {
6084 ++m_callCount; 6084 ++m_callCount;
6085 return 0; 6085 return 0;
6086 } 6086 }
6087 6087
6088 int callCount() const { return m_callCount; } 6088 int callCount() const { return m_callCount; }
6089 6089
6090 private: 6090 private:
6091 int m_callCount; 6091 int m_callCount;
6092 }; 6092 };
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
7006 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 7006 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
7007 7007
7008 // Neither should a page reload. 7008 // Neither should a page reload.
7009 localFrame->reload(); 7009 localFrame->reload();
7010 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 7010 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
7011 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 7011 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
7012 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 7012 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
7013 } 7013 }
7014 7014
7015 } // namespace 7015 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698