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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 { | 232 { |
233 registerMockedHttpURLLoad("iframes_test.html"); | 233 registerMockedHttpURLLoad("iframes_test.html"); |
234 registerMockedHttpURLLoad("visible_iframe.html"); | 234 registerMockedHttpURLLoad("visible_iframe.html"); |
235 registerMockedHttpURLLoad("invisible_iframe.html"); | 235 registerMockedHttpURLLoad("invisible_iframe.html"); |
236 registerMockedHttpURLLoad("zero_sized_iframe.html"); | 236 registerMockedHttpURLLoad("zero_sized_iframe.html"); |
237 | 237 |
238 FrameTestHelpers::WebViewHelper webViewHelper; | 238 FrameTestHelpers::WebViewHelper webViewHelper; |
239 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html", true); | 239 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html", true); |
240 | 240 |
241 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 241 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
242 EXPECT_EQ(webViewHelper.webView()->mainFrame(), WebFrame::frameForContext(we
bViewHelper.webView()->mainFrame()->mainWorldScriptContext())); | 242 EXPECT_EQ(webViewHelper.webView()->mainFrame(), WebLocalFrame::frameForConte
xt(webViewHelper.webView()->mainFrame()->mainWorldScriptContext())); |
243 EXPECT_EQ(webViewHelper.webView()->mainFrame()->firstChild(), WebFrame::fram
eForContext(webViewHelper.webView()->mainFrame()->firstChild()->mainWorldScriptC
ontext())); | 243 EXPECT_EQ(webViewHelper.webView()->mainFrame()->firstChild(), WebLocalFrame:
:frameForContext(webViewHelper.webView()->mainFrame()->firstChild()->mainWorldSc
riptContext())); |
244 } | 244 } |
245 | 245 |
246 TEST_F(WebFrameTest, FormWithNullFrame) | 246 TEST_F(WebFrameTest, FormWithNullFrame) |
247 { | 247 { |
248 registerMockedHttpURLLoad("form.html"); | 248 registerMockedHttpURLLoad("form.html"); |
249 | 249 |
250 FrameTestHelpers::WebViewHelper webViewHelper; | 250 FrameTestHelpers::WebViewHelper webViewHelper; |
251 webViewHelper.initializeAndLoad(m_baseURL + "form.html"); | 251 webViewHelper.initializeAndLoad(m_baseURL + "form.html"); |
252 | 252 |
253 WebVector<WebFormElement> forms; | 253 WebVector<WebFormElement> forms; |
(...skipping 4670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4924 } | 4924 } |
4925 | 4925 |
4926 void setChildWebFrameClient(WebFrameClient* client) { m_client = client; } | 4926 void setChildWebFrameClient(WebFrameClient* client) { m_client = client; } |
4927 WebURLRequest::CachePolicy cachePolicy() const { return m_policy; } | 4927 WebURLRequest::CachePolicy cachePolicy() const { return m_policy; } |
4928 int willSendRequestCallCount() const { return m_willSendRequestCallCount; } | 4928 int willSendRequestCallCount() const { return m_willSendRequestCallCount; } |
4929 int childFrameCreationCount() const { return m_childFrameCreationCount; } | 4929 int childFrameCreationCount() const { return m_childFrameCreationCount; } |
4930 | 4930 |
4931 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString&) | 4931 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString&) |
4932 { | 4932 { |
4933 m_childFrameCreationCount++; | 4933 m_childFrameCreationCount++; |
4934 WebFrame* frame = WebFrame::create(m_client); | 4934 WebFrame* frame = WebLocalFrame::create(m_client); |
4935 parent->appendChild(frame); | 4935 parent->appendChild(frame); |
4936 return frame; | 4936 return frame; |
4937 } | 4937 } |
4938 | 4938 |
4939 virtual void frameDetached(WebFrame* frame) OVERRIDE | 4939 virtual void frameDetached(WebFrame* frame) OVERRIDE |
4940 { | 4940 { |
4941 if (frame->parent()) | 4941 if (frame->parent()) |
4942 frame->parent()->removeChild(frame); | 4942 frame->parent()->removeChild(frame); |
4943 frame->close(); | 4943 frame->close(); |
4944 } | 4944 } |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5394 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); | 5394 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); |
5395 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); | 5395 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); |
5396 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); | 5396 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); |
5397 | 5397 |
5398 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); | 5398 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); |
5399 EXPECT_TRUE(anonymousBlock->isAnonymous()); | 5399 EXPECT_TRUE(anonymousBlock->isAnonymous()); |
5400 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); | 5400 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); |
5401 } | 5401 } |
5402 | 5402 |
5403 } // namespace | 5403 } // namespace |
OLD | NEW |