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 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 webView->layout(); | 2076 webView->layout(); |
2077 WebRect cropRect(0, 0, 100, 100); | 2077 WebRect cropRect(0, 0, 100, 100); |
2078 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 2078 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
2079 EXPECT_STREQ("", clipText.utf8().c_str()); | 2079 EXPECT_STREQ("", clipText.utf8().c_str()); |
2080 EXPECT_STREQ("", clipHtml.utf8().c_str()); | 2080 EXPECT_STREQ("", clipHtml.utf8().c_str()); |
2081 } | 2081 } |
2082 | 2082 |
2083 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { | 2083 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { |
2084 public: | 2084 public: |
2085 CreateChildCounterFrameClient() : m_count(0) { } | 2085 CreateChildCounterFrameClient() : m_count(0) { } |
2086 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags) override; | 2086 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags, const WebFrameOwnerProperties&) override; |
2087 | 2087 |
2088 int count() const { return m_count; } | 2088 int count() const { return m_count; } |
2089 | 2089 |
2090 private: | 2090 private: |
2091 int m_count; | 2091 int m_count; |
2092 }; | 2092 }; |
2093 | 2093 |
2094 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s) | 2094 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s, const WebFrameOwnerProperties& frameOwnerProperties) |
2095 { | 2095 { |
2096 ++m_count; | 2096 ++m_count; |
2097 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags); | 2097 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags, frameOwnerProperties); |
2098 } | 2098 } |
2099 | 2099 |
2100 TEST_F(WebViewTest, ChangeDisplayMode) | 2100 TEST_F(WebViewTest, ChangeDisplayMode) |
2101 { | 2101 { |
2102 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); | 2102 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); |
2103 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); | 2103 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); |
2104 | 2104 |
2105 std::string content = webView->mainFrame()->contentAsText(21).utf8(); | 2105 std::string content = webView->mainFrame()->contentAsText(21).utf8(); |
2106 EXPECT_EQ("regular-ui", content); | 2106 EXPECT_EQ("regular-ui", content); |
2107 | 2107 |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3070 WebFrame* frame = mainWebView.webView()->mainFrame(); | 3070 WebFrame* frame = mainWebView.webView()->mainFrame(); |
3071 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 3071 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
3072 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); | 3072 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); |
3073 ASSERT_TRUE(v8Value->IsObject()); | 3073 ASSERT_TRUE(v8Value->IsObject()); |
3074 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); | 3074 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); |
3075 ASSERT_TRUE(document); | 3075 ASSERT_TRUE(document); |
3076 EXPECT_FALSE(document->frame()->isLoading()); | 3076 EXPECT_FALSE(document->frame()->isLoading()); |
3077 } | 3077 } |
3078 | 3078 |
3079 } // namespace blink | 3079 } // namespace blink |
OLD | NEW |