| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 webView->layout(); | 2107 webView->layout(); |
| 2108 WebRect cropRect(0, 0, 100, 100); | 2108 WebRect cropRect(0, 0, 100, 100); |
| 2109 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 2109 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
| 2110 EXPECT_STREQ("", clipText.utf8().c_str()); | 2110 EXPECT_STREQ("", clipText.utf8().c_str()); |
| 2111 EXPECT_STREQ("", clipHtml.utf8().c_str()); | 2111 EXPECT_STREQ("", clipHtml.utf8().c_str()); |
| 2112 } | 2112 } |
| 2113 | 2113 |
| 2114 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { | 2114 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { |
| 2115 public: | 2115 public: |
| 2116 CreateChildCounterFrameClient() : m_count(0) { } | 2116 CreateChildCounterFrameClient() : m_count(0) { } |
| 2117 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags) override; | 2117 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags, const WebFrameOwnerProperties&) override; |
| 2118 | 2118 |
| 2119 int count() const { return m_count; } | 2119 int count() const { return m_count; } |
| 2120 | 2120 |
| 2121 private: | 2121 private: |
| 2122 int m_count; | 2122 int m_count; |
| 2123 }; | 2123 }; |
| 2124 | 2124 |
| 2125 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s) | 2125 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s, const WebFrameOwnerProperties& frameOwnerProperties) |
| 2126 { | 2126 { |
| 2127 ++m_count; | 2127 ++m_count; |
| 2128 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags); | 2128 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags, frameOwnerProperties); |
| 2129 } | 2129 } |
| 2130 | 2130 |
| 2131 TEST_F(WebViewTest, ChangeDisplayMode) | 2131 TEST_F(WebViewTest, ChangeDisplayMode) |
| 2132 { | 2132 { |
| 2133 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); | 2133 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); |
| 2134 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); | 2134 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); |
| 2135 | 2135 |
| 2136 std::string content = webView->mainFrame()->contentAsText(21).utf8(); | 2136 std::string content = webView->mainFrame()->contentAsText(21).utf8(); |
| 2137 EXPECT_EQ("regular-ui", content); | 2137 EXPECT_EQ("regular-ui", content); |
| 2138 | 2138 |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3101 WebFrame* frame = mainWebView.webView()->mainFrame(); | 3101 WebFrame* frame = mainWebView.webView()->mainFrame(); |
| 3102 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 3102 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 3103 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); | 3103 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); |
| 3104 ASSERT_TRUE(v8Value->IsObject()); | 3104 ASSERT_TRUE(v8Value->IsObject()); |
| 3105 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); | 3105 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); |
| 3106 ASSERT_TRUE(document); | 3106 ASSERT_TRUE(document); |
| 3107 EXPECT_FALSE(document->frame()->isLoading()); | 3107 EXPECT_FALSE(document->frame()->isLoading()); |
| 3108 } | 3108 } |
| 3109 | 3109 |
| 3110 } // namespace blink | 3110 } // namespace blink |
| OLD | NEW |