Title: [122995] trunk/Tools
Revision
122995
Author
[email protected]
Date
2012-07-18 11:34:16 -0700 (Wed, 18 Jul 2012)

Log Message

[chromium] MediaStream API: Moving the mock create* WebRTC calls into a shadow Platform class
https://bugs.webkit.org/show_bug.cgi?id=86215

Reviewed by Adam Barth.

Adding a shadow Platform object that is used to override some WebKit::Platform funtions to
instead create mock objects. No actual mock objects created yet.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/DumpRenderTree.cpp:
(WebKitSupportTestEnvironment::WebKitSupportTestEnvironment):
* DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp: Copied from Tools/DumpRenderTree/chromium/config.h.
(MockWebKitPlatformSupport::create):
(MockWebKitPlatformSupport::MockWebKitPlatformSupport):
(MockWebKitPlatformSupport::cryptographicallyRandomValues):
(MockWebKitPlatformSupport::createMediaStreamCenter):
* DumpRenderTree/chromium/MockWebKitPlatformSupport.h: Copied from Tools/DumpRenderTree/chromium/config.h.
(MockWebKitPlatformSupport):
* DumpRenderTree/chromium/config.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (122994 => 122995)


--- trunk/Tools/ChangeLog	2012-07-18 18:32:24 UTC (rev 122994)
+++ trunk/Tools/ChangeLog	2012-07-18 18:34:16 UTC (rev 122995)
@@ -1,3 +1,25 @@
+2012-07-18  Tommy Widenflycht  <[email protected]>
+
+        [chromium] MediaStream API: Moving the mock create* WebRTC calls into a shadow Platform class
+        https://bugs.webkit.org/show_bug.cgi?id=86215
+
+        Reviewed by Adam Barth.
+
+        Adding a shadow Platform object that is used to override some WebKit::Platform funtions to
+        instead create mock objects. No actual mock objects created yet.
+
+        * DumpRenderTree/DumpRenderTree.gypi:
+        * DumpRenderTree/chromium/DumpRenderTree.cpp:
+        (WebKitSupportTestEnvironment::WebKitSupportTestEnvironment):
+        * DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp: Copied from Tools/DumpRenderTree/chromium/config.h.
+        (MockWebKitPlatformSupport::create):
+        (MockWebKitPlatformSupport::MockWebKitPlatformSupport):
+        (MockWebKitPlatformSupport::cryptographicallyRandomValues):
+        (MockWebKitPlatformSupport::createMediaStreamCenter):
+        * DumpRenderTree/chromium/MockWebKitPlatformSupport.h: Copied from Tools/DumpRenderTree/chromium/config.h.
+        (MockWebKitPlatformSupport):
+        * DumpRenderTree/chromium/config.h:
+
 2012-07-18  Thiago Marcos P. Santos  <[email protected]>
 
         [CMake][EFL] Build and run TestWebKitAPI unit tests

Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.gypi (122994 => 122995)


--- trunk/Tools/DumpRenderTree/DumpRenderTree.gypi	2012-07-18 18:32:24 UTC (rev 122994)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.gypi	2012-07-18 18:34:16 UTC (rev 122995)
@@ -14,6 +14,8 @@
             'chromium/MockGrammarCheck.h',
             'chromium/MockSpellCheck.cpp',
             'chromium/MockSpellCheck.h',
+            'chromium/MockWebKitPlatformSupport.cpp',
+            'chromium/MockWebKitPlatformSupport.h',
             'chromium/MockWebPrerenderingSupport.cpp',
             'chromium/MockWebPrerenderingSupport.h',
             'chromium/MockWebSpeechInputController.cpp',

Modified: trunk/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp (122994 => 122995)


--- trunk/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp	2012-07-18 18:32:24 UTC (rev 122994)
+++ trunk/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp	2012-07-18 18:34:16 UTC (rev 122995)
@@ -30,6 +30,7 @@
 
 #include "config.h"
 
+#include "MockWebKitPlatformSupport.h"
 #include "TestShell.h"
 #include "WebCompositor.h"
 #include "webkit/support/webkit_support.h"
@@ -72,7 +73,7 @@
 public:
     WebKitSupportTestEnvironment()
     {
-        webkit_support::SetUpTestEnvironment();
+        webkit_support::SetUpTestEnvironment(MockWebKitPlatformSupport::create());
     }
     ~WebKitSupportTestEnvironment()
     {

Copied: trunk/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp (from rev 122994, trunk/Tools/DumpRenderTree/chromium/config.h) (0 => 122995)


--- trunk/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp	2012-07-18 18:34:16 UTC (rev 122995)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MockWebKitPlatformSupport.h"
+
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+
+Platform* MockWebKitPlatformSupport::create()
+{
+    return new MockWebKitPlatformSupport();
+}
+
+MockWebKitPlatformSupport::MockWebKitPlatformSupport()
+{
+}
+
+void MockWebKitPlatformSupport::cryptographicallyRandomValues(unsigned char*, size_t)
+{
+    CRASH();
+}
+
+WebMediaStreamCenter* MockWebKitPlatformSupport::createMediaStreamCenter(WebMediaStreamCenterClient*)
+{
+    return 0;
+}

Copied: trunk/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h (from rev 122994, trunk/Tools/DumpRenderTree/chromium/config.h) (0 => 122995)


--- trunk/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h	2012-07-18 18:34:16 UTC (rev 122995)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MockWebKitPlatformSupport_h
+#define MockWebKitPlatformSupport_h
+
+#include <public/Platform.h>
+
+class MockWebKitPlatformSupport : public WebKit::Platform {
+public:
+    static WebKit::Platform* create();
+
+    virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) OVERRIDE;
+
+    virtual WebKit::WebMediaStreamCenter* createMediaStreamCenter(WebKit::WebMediaStreamCenterClient*) OVERRIDE;
+
+private:
+    MockWebKitPlatformSupport();
+};
+
+#endif // MockWebKitPlatformSupport_h

Modified: trunk/Tools/DumpRenderTree/chromium/config.h (122994 => 122995)


--- trunk/Tools/DumpRenderTree/chromium/config.h	2012-07-18 18:32:24 UTC (rev 122994)
+++ trunk/Tools/DumpRenderTree/chromium/config.h	2012-07-18 18:34:16 UTC (rev 122995)
@@ -31,17 +31,6 @@
 #ifndef config_h
 #define config_h
 
-// To avoid confict of LOG in wtf/Assertions.h and LOG in base/logging.h,
-// skip base/loggin.h by defining BASE_LOGGING_H_ and define some macros
-// provided by base/logging.h.
-// FIXME: Remove this hack!
-#include <iostream>
-#define BASE_LOGGING_H_
-#define CHECK(condition) while (false && (condition)) std::cerr
-#define DCHECK(condition) while (false && (condition)) std::cerr
-#define DCHECK_EQ(a, b) while (false && (a) == (b)) std::cerr
-#define DCHECK_NE(a, b) while (false && (a) != (b)) std::cerr
-
 #include <wtf/Platform.h>
 #include <wtf/ExportMacros.h>
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to