| 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 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2114 webView->layout(); | 2114 webView->layout(); |
| 2115 WebRect cropRect(0, 0, 100, 100); | 2115 WebRect cropRect(0, 0, 100, 100); |
| 2116 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 2116 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
| 2117 EXPECT_STREQ("", clipText.utf8().c_str()); | 2117 EXPECT_STREQ("", clipText.utf8().c_str()); |
| 2118 EXPECT_STREQ("", clipHtml.utf8().c_str()); | 2118 EXPECT_STREQ("", clipHtml.utf8().c_str()); |
| 2119 } | 2119 } |
| 2120 | 2120 |
| 2121 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { | 2121 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { |
| 2122 public: | 2122 public: |
| 2123 CreateChildCounterFrameClient() : m_count(0) { } | 2123 CreateChildCounterFrameClient() : m_count(0) { } |
| 2124 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags) override; | 2124 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags, const WebFrameOwnerProperties&) override; |
| 2125 | 2125 |
| 2126 int count() const { return m_count; } | 2126 int count() const { return m_count; } |
| 2127 | 2127 |
| 2128 private: | 2128 private: |
| 2129 int m_count; | 2129 int m_count; |
| 2130 }; | 2130 }; |
| 2131 | 2131 |
| 2132 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s) | 2132 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s, const WebFrameOwnerProperties& frameOwnerProperties) |
| 2133 { | 2133 { |
| 2134 ++m_count; | 2134 ++m_count; |
| 2135 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags); | 2135 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags, frameOwnerProperties); |
| 2136 } | 2136 } |
| 2137 | 2137 |
| 2138 TEST_F(WebViewTest, ChangeDisplayMode) | 2138 TEST_F(WebViewTest, ChangeDisplayMode) |
| 2139 { | 2139 { |
| 2140 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); | 2140 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); |
| 2141 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); | 2141 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); |
| 2142 | 2142 |
| 2143 std::string content = webView->mainFrame()->contentAsText(21).utf8(); | 2143 std::string content = webView->mainFrame()->contentAsText(21).utf8(); |
| 2144 EXPECT_EQ("regular-ui", content); | 2144 EXPECT_EQ("regular-ui", content); |
| 2145 | 2145 |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3108 WebFrame* frame = mainWebView.webView()->mainFrame(); | 3108 WebFrame* frame = mainWebView.webView()->mainFrame(); |
| 3109 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 3109 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 3110 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); | 3110 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); |
| 3111 ASSERT_TRUE(v8Value->IsObject()); | 3111 ASSERT_TRUE(v8Value->IsObject()); |
| 3112 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); | 3112 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); |
| 3113 ASSERT_TRUE(document); | 3113 ASSERT_TRUE(document); |
| 3114 EXPECT_FALSE(document->frame()->isLoading()); | 3114 EXPECT_FALSE(document->frame()->isLoading()); |
| 3115 } | 3115 } |
| 3116 | 3116 |
| 3117 } // namespace blink | 3117 } // namespace blink |
| OLD | NEW |