OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 WebPluginContainer* pluginContainerTwo = getWebPluginContainer(webView, WebS
tring::fromUTF8("rotated-plugin")); | 152 WebPluginContainer* pluginContainerTwo = getWebPluginContainer(webView, WebS
tring::fromUTF8("rotated-plugin")); |
153 ASSERT(pluginContainerTwo); | 153 ASSERT(pluginContainerTwo); |
154 WebPoint point3 = pluginContainerTwo->rootFrameToLocalPoint(WebPoint(0, 10))
; | 154 WebPoint point3 = pluginContainerTwo->rootFrameToLocalPoint(WebPoint(0, 10))
; |
155 ASSERT_EQ(10, point3.x); | 155 ASSERT_EQ(10, point3.x); |
156 ASSERT_EQ(0, point3.y); | 156 ASSERT_EQ(0, point3.y); |
157 WebPoint point4 = pluginContainerTwo->rootFrameToLocalPoint(WebPoint(-10, 10
)); | 157 WebPoint point4 = pluginContainerTwo->rootFrameToLocalPoint(WebPoint(-10, 10
)); |
158 ASSERT_EQ(10, point4.x); | 158 ASSERT_EQ(10, point4.x); |
159 ASSERT_EQ(10, point4.y); | 159 ASSERT_EQ(10, point4.y); |
160 } | 160 } |
161 | 161 |
| 162 TEST_F(WebPluginContainerTest, PluginDocumentPluginIsFocused) |
| 163 { |
| 164 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("test.pdf"), WebString::fromUTF8("application/pdf")
); |
| 165 |
| 166 TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper
. |
| 167 FrameTestHelpers::WebViewHelper webViewHelper; |
| 168 WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", t
rue, &pluginWebFrameClient); |
| 169 ASSERT(webView); |
| 170 webView->layout(); |
| 171 |
| 172 WebDocument document = webView->mainFrame()->document(); |
| 173 EXPECT_TRUE(document.isPluginDocument()); |
| 174 WebPluginContainer* pluginContainer = getWebPluginContainer(webView, "plugin
"); |
| 175 EXPECT_EQ(document.focusedElement(), pluginContainer->element()); |
| 176 } |
| 177 |
162 TEST_F(WebPluginContainerTest, PrintOnePage) | 178 TEST_F(WebPluginContainerTest, PrintOnePage) |
163 { | 179 { |
164 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("test.pdf"), WebString::fromUTF8("application/pdf")
); | 180 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("test.pdf"), WebString::fromUTF8("application/pdf")
); |
165 | 181 |
166 TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper
. | 182 TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper
. |
167 FrameTestHelpers::WebViewHelper webViewHelper; | 183 FrameTestHelpers::WebViewHelper webViewHelper; |
168 WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", t
rue, &pluginWebFrameClient); | 184 WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", t
rue, &pluginWebFrameClient); |
169 ASSERT(webView); | 185 ASSERT(webView); |
170 webView->layout(); | 186 webView->layout(); |
171 runPendingTasks(); | 187 runPendingTasks(); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 TopmostPlugin* testPlugin = static_cast<TopmostPlugin*>(pluginContainerImpl-
>plugin()); | 452 TopmostPlugin* testPlugin = static_cast<TopmostPlugin*>(pluginContainerImpl-
>plugin()); |
437 EXPECT_TRUE(testPlugin->isRectTopmost()); | 453 EXPECT_TRUE(testPlugin->isRectTopmost()); |
438 | 454 |
439 // Cause the plugin's frame to be detached. | 455 // Cause the plugin's frame to be detached. |
440 webViewHelper.reset(); | 456 webViewHelper.reset(); |
441 | 457 |
442 EXPECT_FALSE(pluginContainerImpl->isRectTopmost(topmostRect)); | 458 EXPECT_FALSE(pluginContainerImpl->isRectTopmost(topmostRect)); |
443 } | 459 } |
444 | 460 |
445 } // namespace blink | 461 } // namespace blink |
OLD | NEW |