| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2410 EXPECT_EQ(1.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor()); | 2410 EXPECT_EQ(1.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor()); |
| 2411 EXPECT_EQ(5.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor()); | 2411 EXPECT_EQ(5.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor()); |
| 2412 | 2412 |
| 2413 webViewHelper.webView()->setIgnoreViewportTagScaleLimits(false); | 2413 webViewHelper.webView()->setIgnoreViewportTagScaleLimits(false); |
| 2414 webViewHelper.webView()->layout(); | 2414 webViewHelper.webView()->layout(); |
| 2415 | 2415 |
| 2416 EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor()); | 2416 EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor()); |
| 2417 EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor()); | 2417 EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor()); |
| 2418 } | 2418 } |
| 2419 | 2419 |
| 2420 // Android doesn't have scrollbars on the main FrameView | |
| 2421 #if OS(ANDROID) | |
| 2422 TEST_F(WebFrameTest, DISABLED_updateOverlayScrollbarLayers) | |
| 2423 #else | |
| 2424 TEST_F(WebFrameTest, updateOverlayScrollbarLayers) | 2420 TEST_F(WebFrameTest, updateOverlayScrollbarLayers) |
| 2425 #endif | |
| 2426 { | 2421 { |
| 2427 UseMockScrollbarSettings mockScrollbarSettings; | 2422 UseMockScrollbarSettings mockScrollbarSettings; |
| 2428 | 2423 |
| 2429 registerMockedHttpURLLoad("large-div.html"); | 2424 registerMockedHttpURLLoad("large-div.html"); |
| 2430 | 2425 |
| 2431 int viewWidth = 500; | 2426 int viewWidth = 500; |
| 2432 int viewHeight = 500; | 2427 int viewHeight = 500; |
| 2433 | 2428 |
| 2434 OwnPtr<FakeCompositingWebViewClient> fakeCompositingWebViewClient = adoptPtr
(new FakeCompositingWebViewClient()); | 2429 OwnPtr<FakeCompositingWebViewClient> fakeCompositingWebViewClient = adoptPtr
(new FakeCompositingWebViewClient()); |
| 2435 FrameTestHelpers::WebViewHelper webViewHelper; | 2430 FrameTestHelpers::WebViewHelper webViewHelper; |
| 2436 webViewHelper.initialize(true, 0, fakeCompositingWebViewClient.get(), &confi
gueCompositingWebView); | 2431 webViewHelper.initialize(true, 0, fakeCompositingWebViewClient.get(), &confi
gueCompositingWebView); |
| 2437 | 2432 |
| 2438 webViewHelper.webView()->resize(WebSize(viewWidth, viewHeight)); | 2433 webViewHelper.webView()->resize(WebSize(viewWidth, viewHeight)); |
| 2439 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL
+ "large-div.html"); | 2434 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL
+ "large-div.html"); |
| 2440 | 2435 |
| 2441 FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView(); | 2436 FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView(); |
| 2442 EXPECT_TRUE(view->layoutView()->compositor()->layerForHorizontalScrollbar())
; | 2437 EXPECT_TRUE(view->layoutView()->compositor()->layerForHorizontalScrollbar())
; |
| 2443 EXPECT_TRUE(view->layoutView()->compositor()->layerForVerticalScrollbar()); | 2438 EXPECT_TRUE(view->layoutView()->compositor()->layerForVerticalScrollbar()); |
| 2444 | |
| 2445 webViewHelper.webView()->resize(WebSize(viewWidth * 10, viewHeight * 10)); | |
| 2446 webViewHelper.webView()->layout(); | |
| 2447 EXPECT_FALSE(view->layoutView()->compositor()->layerForHorizontalScrollbar()
); | |
| 2448 EXPECT_FALSE(view->layoutView()->compositor()->layerForVerticalScrollbar()); | |
| 2449 } | 2439 } |
| 2450 | 2440 |
| 2451 void setScaleAndScrollAndLayout(WebViewImpl* webView, WebPoint scroll, float sca
le) | 2441 void setScaleAndScrollAndLayout(WebViewImpl* webView, WebPoint scroll, float sca
le) |
| 2452 { | 2442 { |
| 2453 webView->setPageScaleFactor(scale); | 2443 webView->setPageScaleFactor(scale); |
| 2454 webView->mainFrame()->setScrollOffset(WebSize(scroll.x, scroll.y)); | 2444 webView->mainFrame()->setScrollOffset(WebSize(scroll.x, scroll.y)); |
| 2455 webView->layout(); | 2445 webView->layout(); |
| 2456 } | 2446 } |
| 2457 | 2447 |
| 2458 void simulatePageScale(WebViewImpl* webViewImpl, float& scale) | 2448 void simulatePageScale(WebViewImpl* webViewImpl, float& scale) |
| (...skipping 5576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8035 | 8025 |
| 8036 TEST_F(WebFrameTest, MaxFramesDetach) | 8026 TEST_F(WebFrameTest, MaxFramesDetach) |
| 8037 { | 8027 { |
| 8038 registerMockedHttpURLLoad("max-frames-detach.html"); | 8028 registerMockedHttpURLLoad("max-frames-detach.html"); |
| 8039 FrameTestHelpers::WebViewHelper webViewHelper; | 8029 FrameTestHelpers::WebViewHelper webViewHelper; |
| 8040 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 8030 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
| 8041 webViewImpl->mainFrameImpl()->collectGarbage(); | 8031 webViewImpl->mainFrameImpl()->collectGarbage(); |
| 8042 } | 8032 } |
| 8043 | 8033 |
| 8044 } // namespace blink | 8034 } // namespace blink |
| OLD | NEW |