Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: Source/web/tests/WebViewTest.cpp

Issue 1319863006: (blink) Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments + static_cast for enum conversion Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 webView->layout(); 2067 webView->layout();
2068 WebRect cropRect(0, 0, 100, 100); 2068 WebRect cropRect(0, 0, 100, 100);
2069 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); 2069 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect);
2070 EXPECT_STREQ("", clipText.utf8().c_str()); 2070 EXPECT_STREQ("", clipText.utf8().c_str());
2071 EXPECT_STREQ("", clipHtml.utf8().c_str()); 2071 EXPECT_STREQ("", clipHtml.utf8().c_str());
2072 } 2072 }
2073 2073
2074 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t { 2074 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien t {
2075 public: 2075 public:
2076 CreateChildCounterFrameClient() : m_count(0) { } 2076 CreateChildCounterFrameClient() : m_count(0) { }
2077 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We bString& frameName, WebSandboxFlags) override; 2077 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We bString& frameName, WebSandboxFlags, const WebFrameOwnerProperties&) override;
2078 2078
2079 int count() const { return m_count; } 2079 int count() const { return m_count; }
2080 2080
2081 private: 2081 private:
2082 int m_count; 2082 int m_count;
2083 }; 2083 };
2084 2084
2085 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag s) 2085 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag s, const WebFrameOwnerProperties& frameOwnerProperties)
2086 { 2086 {
2087 ++m_count; 2087 ++m_count;
2088 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo xFlags); 2088 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo xFlags, frameOwnerProperties);
2089 } 2089 }
2090 2090
2091 TEST_F(WebViewTest, ChangeDisplayMode) 2091 TEST_F(WebViewTest, ChangeDisplayMode)
2092 { 2092 {
2093 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("display_mode.html")); 2093 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("display_mode.html"));
2094 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo de.html", true); 2094 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo de.html", true);
2095 2095
2096 std::string content = webView->mainFrame()->contentAsText(21).utf8(); 2096 std::string content = webView->mainFrame()->contentAsText(21).utf8();
2097 EXPECT_EQ("regular-ui", content); 2097 EXPECT_EQ("regular-ui", content);
2098 2098
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
3061 WebFrame* frame = mainWebView.webView()->mainFrame(); 3061 WebFrame* frame = mainWebView.webView()->mainFrame();
3062 v8::HandleScope scope(v8::Isolate::GetCurrent()); 3062 v8::HandleScope scope(v8::Isolate::GetCurrent());
3063 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS ource("var win = window.open('javascript:false'); win.document")); 3063 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS ource("var win = window.open('javascript:false'); win.document"));
3064 ASSERT_TRUE(v8Value->IsObject()); 3064 ASSERT_TRUE(v8Value->IsObject());
3065 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent (), v8Value); 3065 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent (), v8Value);
3066 ASSERT_TRUE(document); 3066 ASSERT_TRUE(document);
3067 EXPECT_FALSE(document->frame()->isLoading()); 3067 EXPECT_FALSE(document->frame()->isLoading());
3068 } 3068 }
3069 3069
3070 } // namespace blink 3070 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698