| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // timed-out DRT process was crashed. | 128 // timed-out DRT process was crashed. |
| 129 m_timeout = 30 * 1000; | 129 m_timeout = 30 * 1000; |
| 130 } | 130 } |
| 131 | 131 |
| 132 void TestShell::initialize(MockPlatform* platformSupport) | 132 void TestShell::initialize(MockPlatform* platformSupport) |
| 133 { | 133 { |
| 134 m_testInterfaces = adoptPtr(new WebTestInterfaces()); | 134 m_testInterfaces = adoptPtr(new WebTestInterfaces()); |
| 135 platformSupport->setInterfaces(m_testInterfaces.get()); | 135 platformSupport->setInterfaces(m_testInterfaces.get()); |
| 136 m_devToolsTestInterfaces = adoptPtr(new WebTestInterfaces()); | 136 m_devToolsTestInterfaces = adoptPtr(new WebTestInterfaces()); |
| 137 m_prerenderingSupport = adoptPtr(new MockWebPrerenderingSupport()); | 137 m_prerenderingSupport = adoptPtr(new MockWebPrerenderingSupport()); |
| 138 #if !defined(USE_DEFAULT_RENDER_THEME) && (OS(WINDOWS) || OS(MAC_OS_X)) | 138 #if !defined(USE_DEFAULT_RENDER_THEME) && (OS(WINDOWS) || OS(DARWIN)) |
| 139 // Set theme engine. | 139 // Set theme engine. |
| 140 webkit_support::SetThemeEngine(m_testInterfaces->themeEngine()); | 140 webkit_support::SetThemeEngine(m_testInterfaces->themeEngine()); |
| 141 #endif | 141 #endif |
| 142 | 142 |
| 143 WTF::initializeThreading(); | 143 WTF::initializeThreading(); |
| 144 | 144 |
| 145 if (m_threadedCompositingEnabled) | 145 if (m_threadedCompositingEnabled) |
| 146 m_webCompositorThread = adoptPtr(WebKit::Platform::current()->createThre
ad("Compositor")); | 146 m_webCompositorThread = adoptPtr(WebKit::Platform::current()->createThre
ad("Compositor")); |
| 147 webkit_support::SetThreadedCompositorEnabled(m_threadedCompositingEnabled); | 147 webkit_support::SetThreadedCompositorEnabled(m_threadedCompositingEnabled); |
| 148 | 148 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 fflush(stderr); | 394 fflush(stderr); |
| 395 } | 395 } |
| 396 | 396 |
| 397 void TestShell::dumpImage(SkCanvas* canvas) const | 397 void TestShell::dumpImage(SkCanvas* canvas) const |
| 398 { | 398 { |
| 399 // Fix the alpha. The expected PNGs on Mac have an alpha channel, so we want | 399 // Fix the alpha. The expected PNGs on Mac have an alpha channel, so we want |
| 400 // to keep it. On Windows, the alpha channel is wrong since text/form contro
l | 400 // to keep it. On Windows, the alpha channel is wrong since text/form contro
l |
| 401 // drawing may have erased it in a few places. So on Windows we force it to | 401 // drawing may have erased it in a few places. So on Windows we force it to |
| 402 // opaque and also don't write the alpha channel for the reference. Linux | 402 // opaque and also don't write the alpha channel for the reference. Linux |
| 403 // doesn't have the wrong alpha like Windows, but we match Windows. | 403 // doesn't have the wrong alpha like Windows, but we match Windows. |
| 404 #if OS(MAC_OS_X) | 404 #if OS(DARWIN) |
| 405 bool discardTransparency = false; | 405 bool discardTransparency = false; |
| 406 #else | 406 #else |
| 407 bool discardTransparency = true; | 407 bool discardTransparency = true; |
| 408 makeCanvasOpaque(canvas); | 408 makeCanvasOpaque(canvas); |
| 409 #endif | 409 #endif |
| 410 | 410 |
| 411 const SkBitmap& sourceBitmap = canvas->getTopDevice()->accessBitmap(false); | 411 const SkBitmap& sourceBitmap = canvas->getTopDevice()->accessBitmap(false); |
| 412 SkAutoLockPixels sourceBitmapLock(sourceBitmap); | 412 SkAutoLockPixels sourceBitmapLock(sourceBitmap); |
| 413 | 413 |
| 414 // Compute MD5 sum. | 414 // Compute MD5 sum. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 for (size_t index = 0; index < entryCount; ++index) { | 555 for (size_t index = 0; index < entryCount; ++index) { |
| 556 WebHistoryItem historyItem = navigationController.entryAtIndex(index)->c
ontentState(); | 556 WebHistoryItem historyItem = navigationController.entryAtIndex(index)->c
ontentState(); |
| 557 if (historyItem.isNull()) { | 557 if (historyItem.isNull()) { |
| 558 historyItem.initialize(); | 558 historyItem.initialize(); |
| 559 historyItem.setURLString(navigationController.entryAtIndex(index)->U
RL().spec().utf16()); | 559 historyItem.setURLString(navigationController.entryAtIndex(index)->U
RL().spec().utf16()); |
| 560 } | 560 } |
| 561 result[index] = historyItem; | 561 result[index] = historyItem; |
| 562 } | 562 } |
| 563 history->swap(result); | 563 history->swap(result); |
| 564 } | 564 } |
| OLD | NEW |