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