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 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2200 webView->updateAllLifecyclePhases(); | 2200 webView->updateAllLifecyclePhases(); |
2201 WebRect cropRect(0, 0, 100, 100); | 2201 WebRect cropRect(0, 0, 100, 100); |
2202 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 2202 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
2203 EXPECT_STREQ("", clipText.utf8().c_str()); | 2203 EXPECT_STREQ("", clipText.utf8().c_str()); |
2204 EXPECT_STREQ("", clipHtml.utf8().c_str()); | 2204 EXPECT_STREQ("", clipHtml.utf8().c_str()); |
2205 } | 2205 } |
2206 | 2206 |
2207 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { | 2207 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { |
2208 public: | 2208 public: |
2209 CreateChildCounterFrameClient() : m_count(0) { } | 2209 CreateChildCounterFrameClient() : m_count(0) { } |
2210 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, WebSandboxFlags, const WebFrameOwnerProperties&) override; | 2210 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We
bString& frameName, const WebString& frameUniqueName, WebSandboxFlags, const Web
FrameOwnerProperties&) override; |
2211 | 2211 |
2212 int count() const { return m_count; } | 2212 int count() const { return m_count; } |
2213 | 2213 |
2214 private: | 2214 private: |
2215 int m_count; | 2215 int m_count; |
2216 }; | 2216 }; |
2217 | 2217 |
2218 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlag
s, const WebFrameOwnerProperties& frameOwnerProperties) | 2218 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
WebTreeScopeType scope, const WebString& frameName, const WebString& frameUniqu
eName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerPr
operties) |
2219 { | 2219 { |
2220 ++m_count; | 2220 ++m_count; |
2221 return TestWebFrameClient::createChildFrame(parent, scope, frameName, sandbo
xFlags, frameOwnerProperties); | 2221 return TestWebFrameClient::createChildFrame(parent, scope, frameName, frameU
niqueName, sandboxFlags, frameOwnerProperties); |
2222 } | 2222 } |
2223 | 2223 |
2224 TEST_F(WebViewTest, ChangeDisplayMode) | 2224 TEST_F(WebViewTest, ChangeDisplayMode) |
2225 { | 2225 { |
2226 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); | 2226 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); |
2227 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); | 2227 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); |
2228 | 2228 |
2229 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma
inFrame()->toWebLocalFrame(), 21).utf8(); | 2229 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma
inFrame()->toWebLocalFrame(), 21).utf8(); |
2230 EXPECT_EQ("regular-ui", content); | 2230 EXPECT_EQ("regular-ui", content); |
2231 | 2231 |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3242 frame->setAutofillClient(&client); | 3242 frame->setAutofillClient(&client); |
3243 webView->setInitialFocus(false); | 3243 webView->setInitialFocus(false); |
3244 | 3244 |
3245 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3245 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
3246 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3246 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
3247 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3247 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
3248 frame->setAutofillClient(0); | 3248 frame->setAutofillClient(0); |
3249 } | 3249 } |
3250 | 3250 |
3251 } // namespace blink | 3251 } // namespace blink |
OLD | NEW |