| 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 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2187 // doesn't cause compositing | 2187 // doesn't cause compositing |
| 2188 webViewHelper.webView()->settings()->setViewportEnabled(true); | 2188 webViewHelper.webView()->settings()->setViewportEnabled(true); |
| 2189 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); | 2189 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); |
| 2190 webViewHelper.webView()->layout(); | 2190 webViewHelper.webView()->layout(); |
| 2191 | 2191 |
| 2192 // Set <1 page scale so that the clip rect should be larger than | 2192 // Set <1 page scale so that the clip rect should be larger than |
| 2193 // the viewport size as passed into resize(). | 2193 // the viewport size as passed into resize(). |
| 2194 webViewHelper.webView()->setPageScaleFactor(0.5); | 2194 webViewHelper.webView()->setPageScaleFactor(0.5); |
| 2195 | 2195 |
| 2196 SkBitmap bitmap; | 2196 SkBitmap bitmap; |
| 2197 ASSERT_TRUE(bitmap.allocN32Pixels(200, 200)); | 2197 bitmap.allocN32Pixels(200, 200); |
| 2198 bitmap.eraseColor(0); | 2198 bitmap.eraseColor(0); |
| 2199 SkCanvas canvas(bitmap); | 2199 SkCanvas canvas(bitmap); |
| 2200 | 2200 |
| 2201 blink::GraphicsContext context(&canvas); | 2201 blink::GraphicsContext context(&canvas); |
| 2202 context.setRegionTrackingMode(GraphicsContext::RegionTrackingOpaque); | 2202 context.setRegionTrackingMode(GraphicsContext::RegionTrackingOpaque); |
| 2203 | 2203 |
| 2204 EXPECT_EQ_RECT(blink::IntRect(0, 0, 0, 0), context.opaqueRegion().asRect()); | 2204 EXPECT_EQ_RECT(blink::IntRect(0, 0, 0, 0), context.opaqueRegion().asRect()); |
| 2205 | 2205 |
| 2206 blink::FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); | 2206 blink::FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); |
| 2207 blink::IntRect paintRect(0, 0, 200, 200); | 2207 blink::IntRect paintRect(0, 0, 200, 200); |
| (...skipping 3609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5817 webViewHelper.initializeAndLoad(m_baseURL + "foo.html", true); | 5817 webViewHelper.initializeAndLoad(m_baseURL + "foo.html", true); |
| 5818 WebFrame* frame = webViewHelper.webView()->mainFrame(); | 5818 WebFrame* frame = webViewHelper.webView()->mainFrame(); |
| 5819 FrameTestHelpers::reloadFrameIgnoringCache(frame); | 5819 FrameTestHelpers::reloadFrameIgnoringCache(frame); |
| 5820 EXPECT_EQ(WebURLRequest::ReloadBypassingCache, frame->dataSource()->request(
).cachePolicy()); | 5820 EXPECT_EQ(WebURLRequest::ReloadBypassingCache, frame->dataSource()->request(
).cachePolicy()); |
| 5821 } | 5821 } |
| 5822 | 5822 |
| 5823 static void nodeImageTestValidation(const blink::IntSize& referenceBitmapSize, b
link::DragImage* dragImage) | 5823 static void nodeImageTestValidation(const blink::IntSize& referenceBitmapSize, b
link::DragImage* dragImage) |
| 5824 { | 5824 { |
| 5825 // Prepare the reference bitmap. | 5825 // Prepare the reference bitmap. |
| 5826 SkBitmap bitmap; | 5826 SkBitmap bitmap; |
| 5827 ASSERT_TRUE(bitmap.allocN32Pixels(referenceBitmapSize.width(), referenceBitm
apSize.height())); | 5827 bitmap.allocN32Pixels(referenceBitmapSize.width(), referenceBitmapSize.heigh
t()); |
| 5828 SkCanvas canvas(bitmap); | 5828 SkCanvas canvas(bitmap); |
| 5829 canvas.drawColor(SK_ColorGREEN); | 5829 canvas.drawColor(SK_ColorGREEN); |
| 5830 | 5830 |
| 5831 EXPECT_EQ(referenceBitmapSize.width(), dragImage->size().width()); | 5831 EXPECT_EQ(referenceBitmapSize.width(), dragImage->size().width()); |
| 5832 EXPECT_EQ(referenceBitmapSize.height(), dragImage->size().height()); | 5832 EXPECT_EQ(referenceBitmapSize.height(), dragImage->size().height()); |
| 5833 const SkBitmap& dragBitmap = dragImage->bitmap(); | 5833 const SkBitmap& dragBitmap = dragImage->bitmap(); |
| 5834 SkAutoLockPixels lockPixel(dragBitmap); | 5834 SkAutoLockPixels lockPixel(dragBitmap); |
| 5835 EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSi
ze())); | 5835 EXPECT_EQ(0, memcmp(bitmap.getPixels(), dragBitmap.getPixels(), bitmap.getSi
ze())); |
| 5836 } | 5836 } |
| 5837 | 5837 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6179 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6179 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6180 | 6180 |
| 6181 // Neither should a page reload. | 6181 // Neither should a page reload. |
| 6182 localFrame->reload(); | 6182 localFrame->reload(); |
| 6183 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6183 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
| 6184 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6184 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
| 6185 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6185 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6186 } | 6186 } |
| 6187 | 6187 |
| 6188 } // namespace | 6188 } // namespace |
| OLD | NEW |