Title: [156045] trunk
Revision
156045
Author
commit-qu...@webkit.org
Date
2013-09-18 09:33:18 -0700 (Wed, 18 Sep 2013)

Log Message

[Win] TestWebKitAPI does not compile.
https://bugs.webkit.org/show_bug.cgi?id=121485

Patch by pe...@outlook.com <pe...@outlook.com> on 2013-09-18
Reviewed by Brent Fulgham.

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Export needed symbols.

Tools:

It is no longer possible to inherit from WebCore::BitmapImage, which the test relies on.
Instead, load a bitmap, then destroy the decoded data, which will cause WebCore::frameAtIndex()
to return null, which is the case we want to test.

* TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (156044 => 156045)


--- trunk/Source/WebKit/ChangeLog	2013-09-18 16:27:02 UTC (rev 156044)
+++ trunk/Source/WebKit/ChangeLog	2013-09-18 16:33:18 UTC (rev 156045)
@@ -1,3 +1,12 @@
+2013-09-18  pe...@outlook.com  <pe...@outlook.com>
+
+        [Win] TestWebKitAPI does not compile.
+        https://bugs.webkit.org/show_bug.cgi?id=121485
+
+        Reviewed by Brent Fulgham.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Export needed symbols.
+
 2013-09-17  Andreas Kling  <akl...@apple.com>
 
         Some build juice for Windows.

Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (156044 => 156045)


--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2013-09-18 16:27:02 UTC (rev 156044)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2013-09-18 16:33:18 UTC (rev 156045)
@@ -382,6 +382,8 @@
 #endif
         symbolWithPointer(?getHBITMAP@BitmapImage@WebCore@@UAE_NPAUHBITMAP__@@@Z, ?getHBITMAP@BitmapImage@WebCore@@UEAA_NPEAUHBITMAP__@@@Z)
         ?getHBITMAPOfSize@BitmapImage@WebCore@@UAE_NPAUHBITMAP__@@PBVIntSize@2@@Z
+        ?create@BitmapImage@WebCore@@SA?AV?$PassRefPtr@VBitmapImage@WebCore@@@WTF@@PAUHBITMAP__@@@Z
+        ?create@BitmapInfo@WebCore@@SA?AU12@ABVIntSize@2@W4BitCount@12@@Z
         symbolWithPointer(?drawPattern@Image@WebCore@@UAEXPAVGraphicsContext@2@ABVFloatRect@2@ABVAffineTransform@2@ABVFloatPoint@2@W4ColorSpace@2@W4CompositeOperator@2@1W4BlendMode@2@@Z, ?drawPattern@Image@WebCore@@UEAAXPEAVGraphicsContext@2@AEBVFloatRect@2@AEBVAffineTransform@2@AEBVFloatPoint@2@W4ColorSpace@2@W4CompositeOperator@2@1W4BlendMode@2@@Z)
         symbolWithPointer(?drawFrameMatchingSourceSize@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@ABVIntSize@2@W4ColorSpace@2@W4CompositeOperator@2@@Z, ?drawFrameMatchingSourceSize@BitmapImage@WebCore@@MEAAXPEAVGraphicsContext@2@AEBVFloatRect@2@AEBVIntSize@2@W4ColorSpace@2@W4CompositeOperator@2@@Z)
         symbolWithPointer(?mayFillWithSolidColor@BitmapImage@WebCore@@MAE_NXZ, ?mayFillWithSolidColor@BitmapImage@WebCore@@MEAA_NXZ)

Modified: trunk/Tools/ChangeLog (156044 => 156045)


--- trunk/Tools/ChangeLog	2013-09-18 16:27:02 UTC (rev 156044)
+++ trunk/Tools/ChangeLog	2013-09-18 16:33:18 UTC (rev 156045)
@@ -1,3 +1,17 @@
+2013-09-18  pe...@outlook.com  <pe...@outlook.com>
+
+        [Win] TestWebKitAPI does not compile.
+        https://bugs.webkit.org/show_bug.cgi?id=121485
+
+        Reviewed by Brent Fulgham.
+
+        It is no longer possible to inherit from WebCore::BitmapImage, which the test relies on.
+        Instead, load a bitmap, then destroy the decoded data, which will cause WebCore::frameAtIndex()
+        to return null, which is the case we want to test.
+
+        * TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp:
+        (TestWebKitAPI::TEST):
+
 2013-09-18  Mario Sanchez Prada  <mario.pr...@samsung.com>
 
         [ATK] Expose aria-haspopup and aria-sort without the 'aria-' prefix

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp (156044 => 156045)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp	2013-09-18 16:27:02 UTC (rev 156044)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp	2013-09-18 16:33:18 UTC (rev 156045)
@@ -26,6 +26,8 @@
 
 #include "config.h"
 #include <WebCore/BitmapImage.h>
+#include <WebCore/BitmapInfo.h>
+#include <wtf/win/GDIObject.h>
 
 using namespace WebCore;
 
@@ -34,26 +36,26 @@
 // Test that there is no crash when BitmapImage::getHBITMAPOfSize() is called
 // for an image with empty frames (BitmapImage::frameAtIndex(i) return null), WebKit Bug 102689.
 
-class BitmapImageTest : public WebCore::BitmapImage {
-public:
-    BitmapImageTest()
-    {
-        m_frames.grow(1);
-    }
-
-    virtual size_t frameCount()
-    {
-        return 1;
-    }
-};
-
 TEST(WebCore, BitmapImageEmptyFrameTest)
 {
     IntSize sz(16, 16);
-    RefPtr<BitmapImageTest> bitmapImageTest = adoptRef(new BitmapImageTest);
+
+    BitmapInfo bitmapInfo = BitmapInfo::create(sz);
+
+    auto bmp = adoptGDIObject(CreateDIBSection(0, &bitmapInfo, DIB_RGB_COLORS, 0, 0, 0));
+
+    RefPtr<Image> bitmapImageTest = BitmapImage::create(bmp.get());
+
+    if (!bitmapImageTest)
+        return;
+
+    // Destroying decoded data will cause frameAtIndex(i) to return null.
+    bitmapImageTest->destroyDecodedData();
+
     int bits[256];
-    HBITMAP hBitmap = CreateBitmap(sz.width(), sz.height(), 1, 32, bits);
-    bitmapImageTest->getHBITMAPOfSize(hBitmap, &sz);
+    auto bitmap = adoptGDIObject(CreateBitmap(sz.width(), sz.height(), 1, 32, bits));
+
+    bitmapImageTest->getHBITMAPOfSize(bitmap.get(), &sz);
 }
 
 } // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to