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 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 webView->updateAllLifecyclePhases(); | 2179 webView->updateAllLifecyclePhases(); |
2180 WebRect cropRect(0, 0, 100, 100); | 2180 WebRect cropRect(0, 0, 100, 100); |
2181 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 2181 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
2182 EXPECT_STREQ("", clipText.utf8().c_str()); | 2182 EXPECT_STREQ("", clipText.utf8().c_str()); |
2183 EXPECT_STREQ("", clipHtml.utf8().c_str()); | 2183 EXPECT_STREQ("", clipHtml.utf8().c_str()); |
2184 } | 2184 } |
2185 | 2185 |
2186 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { | 2186 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { |
2187 public: | 2187 public: |
2188 CreateChildCounterFrameClient() : m_count(0) { } | 2188 CreateChildCounterFrameClient() : m_count(0) { } |
2189 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags, const WebFrameOwnerProperties&) override; | 2189 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, const WebString& frameUniqueName, WebSandboxFlags, const Web
FrameOwnerProperties&) override; |
2190 | 2190 |
2191 int count() const { return m_count; } | 2191 int count() const { return m_count; } |
2192 | 2192 |
2193 private: | 2193 private: |
2194 int m_count; | 2194 int m_count; |
2195 }; | 2195 }; |
2196 | 2196 |
2197 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s, const WebFrameOwnerProperties& frameOwnerProperties) | 2197 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, const WebString& frameUniqu
eName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerPr
operties) |
2198 { | 2198 { |
2199 ++m_count; | 2199 ++m_count; |
2200 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags, frameOwnerProperties); | 2200 return TestWebFrameClient::createChildFrame(parent, scope, frameName, frameU
niqueName, sandboxFlags, frameOwnerProperties); |
2201 } | 2201 } |
2202 | 2202 |
2203 TEST_F(WebViewTest, ChangeDisplayMode) | 2203 TEST_F(WebViewTest, ChangeDisplayMode) |
2204 { | 2204 { |
2205 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); | 2205 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); |
2206 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); | 2206 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); |
2207 | 2207 |
2208 std::string content = webView->mainFrame()->contentAsText(21).utf8(); | 2208 std::string content = webView->mainFrame()->contentAsText(21).utf8(); |
2209 EXPECT_EQ("regular-ui", content); | 2209 EXPECT_EQ("regular-ui", content); |
2210 | 2210 |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3177 WebFrame* frame = mainWebView.webView()->mainFrame(); | 3177 WebFrame* frame = mainWebView.webView()->mainFrame(); |
3178 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 3178 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
3179 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); | 3179 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); |
3180 ASSERT_TRUE(v8Value->IsObject()); | 3180 ASSERT_TRUE(v8Value->IsObject()); |
3181 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); | 3181 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); |
3182 ASSERT_TRUE(document); | 3182 ASSERT_TRUE(document); |
3183 EXPECT_FALSE(document->frame()->isLoading()); | 3183 EXPECT_FALSE(document->frame()->isLoading()); |
3184 } | 3184 } |
3185 | 3185 |
3186 } // namespace blink | 3186 } // namespace blink |
OLD | NEW |