Changeset 142165 in webkit


Ignore:
Timestamp:
Feb 7, 2013 12:58:25 PM (11 years ago)
Author:
jochen@chromium.org
Message:

[chromium] turn TestRunner library into a component build
https://bugs.webkit.org/show_bug.cgi?id=108466

Reviewed by Adam Barth.

To achieve this, we need to drop all dependencies on WTF.

  • DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
  • DumpRenderTree/DumpRenderTree.gypi:
  • DumpRenderTree/chromium/TestRunner/public/WebPreferences.h:
  • DumpRenderTree/chromium/TestRunner/public/WebTask.h:
  • DumpRenderTree/chromium/TestRunner/public/WebTestCommon.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h.
  • DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h:
  • DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
  • DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:

(WebTestRunner::AccessibilityUIElement::AccessibilityUIElement):
(WebTestRunner::AccessibilityUIElementList::getOrCreate):
(WebTestRunner::AccessibilityUIElementList::createRoot):

  • DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:

(AccessibilityUIElementList):

  • DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp:

(WebTestRunner::CppBoundClass::~CppBoundClass):
(WebTestRunner::CppBoundClass::invoke):
(WebTestRunner::CppBoundClass::getProperty):
(WebTestRunner::CppBoundClass::setProperty):
(WebTestRunner::CppBoundClass::bindCallback):
(WebTestRunner::CppBoundClass::bindGetterCallback):
(WebTestRunner::CppBoundClass::bindProperty):
(WebTestRunner::CppBoundClass::getAsCppVariant):

  • DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h:

(WebTestRunner):
(CppBoundClass):
(WebTestRunner::CppBoundClass::bindProperty):
(WebTestRunner::CppBoundClass::bindFallbackCallback):
(WebTestRunner::CppBoundClass::bindFallbackMethod):

  • DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp:

(WebTestRunner::CppVariant::toString):
(WebTestRunner::CppVariant::toInt32):
(WebTestRunner::CppVariant::toDouble):
(WebTestRunner::CppVariant::toBoolean):
(WebTestRunner::CppVariant::toStringVector):
(WebTestRunner::CppVariant::invoke):
(WebTestRunner::CppVariant::invokeDefault):

  • DumpRenderTree/chromium/TestRunner/src/CppVariant.h:

(CppVariant):

  • DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:

(WebTestRunner):
(WebTestRunner::EventSender::EventSender):
(WebTestRunner::EventSender::reset):
(WebTestRunner::EventSender::mouseDown):
(WebTestRunner::EventSender::mouseUp):
(WebTestRunner::EventSender::mouseMoveTo):
(WebTestRunner::EventSender::keyDown):
(WebTestRunner::EventSender::dispatchMessage):
(WebTestRunner::EventSender::leapForward):
(WebTestRunner::EventSender::replaySavedEvents):
(WebTestRunner::makeMenuItemStringsFor):
(WebTestRunner::EventSender::contextClick):
(WebTestRunner::EventSender::beginDragWithFiles):
(WebTestRunner::EventSender::addTouchPoint):
(WebTestRunner::EventSender::releaseTouchPoint):
(WebTestRunner::EventSender::updateTouchPoint):
(WebTestRunner::EventSender::cancelTouchPoint):
(WebTestRunner::EventSender::sendCurrentTouchEvent):
(WebTestRunner::EventSender::gestureEvent):

  • DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp:

(WebTestRunner::NativeKeyCodeForWindowsKeyCode):

  • DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.cpp:

(WebTestRunner::MockGrammarCheck::checkGrammarOfString):
(WebTestRunner):

  • DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.h:

(WebTestRunner):
(MockGrammarCheck):

  • DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp:

(WebTestRunner::MockSpellCheck::spellCheckWord):
(WebTestRunner::MockSpellCheck::initializeIfNeeded):
(WebTestRunner):

  • DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h:

(MockSpellCheck):

  • DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp:

(WebTestRunner::SpellCheckClient::checkTextOfParagraph):
(WebTestRunner::SpellCheckClient::finishLastTextCheck):

  • DumpRenderTree/chromium/TestRunner/src/TestCommon.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h.

(isASCIIAlpha):
(isNotASCIIAlpha):

  • DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:

(WebTestRunner::TestInterfaces::TestInterfaces):

  • DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:

(TestInterfaces):

  • DumpRenderTree/chromium/TestRunner/src/TestPlugin.cpp:

(WebTestRunner::TestPlugin::TestPlugin):
(WebTestRunner::TestPlugin::initialize):
(WebTestRunner::TestPlugin::destroy):
(WebTestRunner::TestPlugin::parsePrimitive):
(WebTestRunner::TestPlugin::parseColor):
(WebTestRunner::TestPlugin::initProgram):
(WebTestRunner::TestPlugin::initPrimitive):
(WebTestRunner::TestPlugin::drawPrimitive):
(WebTestRunner::TestPlugin::loadShader):
(WebTestRunner::TestPlugin::loadProgram):
(WebTestRunner::TestPlugin::handleDragStatusUpdate):

  • DumpRenderTree/chromium/TestRunner/src/TestPlugin.h:

(TestPlugin):

  • DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:

(WebTestRunner::TestRunner::WorkQueue::processWorkSoon):
(WebTestRunner::TestRunner::WorkQueue::processWork):
(WebTestRunner::TestRunner::WorkQueue::reset):
(WebTestRunner::TestRunner::WorkQueue::addWork):
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::policyDelegateDone):
(WebTestRunner::TestRunner::findString):
(WebTestRunner::TestRunner::setTextSubpixelPositioning):
(WebTestRunner::TestRunner::overridePreference):
(WebTestRunner::TestRunner::deliverWebIntent):
(WebTestRunner::TestRunner::setBackingScaleFactor):
(WebTestRunner::TestRunner::simulateLegacyWebNotificationClick):
(WebTestRunner::TestRunner::setMockSpeechInputDumpRect):
(WebTestRunner::TestRunner::wasMockSpeechRecognitionAborted):
(WebTestRunner::TestRunner::setPointerLockWillFailSynchronously):

  • DumpRenderTree/chromium/TestRunner/src/TestRunner.h:

(WebTestRunner::TestRunner::WorkQueue::isEmpty):
(TestRunner):

  • DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp:

(WebTestRunner::TextInputController::markedRange):
(WebTestRunner::TextInputController::selectedRange):
(WebTestRunner::TextInputController::firstRectForCharacterRange):

  • DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp:

(WebTestRunner::WebPreferences::reset):

  • DumpRenderTree/chromium/TestRunner/src/WebTask.cpp:

(WebTestRunner::WebTaskList::~WebTaskList):
(WebTestRunner::WebTaskList::registerTask):
(WebTestRunner::WebTaskList::unregisterTask):
(WebTestRunner::WebTaskList::revokeAll):

  • DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp:

(WebTestRunner::WebTestInterfaces::WebTestInterfaces):
(WebTestRunner::WebTestInterfaces::~WebTestInterfaces):
(WebTestRunner::WebTestInterfaces::testInterfaces):

  • DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:

(WebTestRunner::WebTestProxyBase::~WebTestProxyBase):
(WebTestRunner::WebTestProxyBase::spellCheckClient):
(WebTestRunner::WebTestProxyBase::registerIntentService):
(WebTestRunner::WebTestProxyBase::dispatchIntent):
(WebTestRunner::WebTestProxyBase::assignIdentifierToRequest):

  • DumpRenderTree/chromium/TestRunner/src/config.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h.
Location:
trunk/Tools
Files:
31 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r142156 r142165  
     12013-02-07  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] turn TestRunner library into a component build
     4        https://bugs.webkit.org/show_bug.cgi?id=108466
     5
     6        Reviewed by Adam Barth.
     7
     8        To achieve this, we need to drop all dependencies on WTF.
     9
     10        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
     11        * DumpRenderTree/DumpRenderTree.gypi:
     12        * DumpRenderTree/chromium/TestRunner/public/WebPreferences.h:
     13        * DumpRenderTree/chromium/TestRunner/public/WebTask.h:
     14        * DumpRenderTree/chromium/TestRunner/public/WebTestCommon.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h.
     15        * DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h:
     16        * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
     17        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
     18        (WebTestRunner::AccessibilityUIElement::AccessibilityUIElement):
     19        (WebTestRunner::AccessibilityUIElementList::getOrCreate):
     20        (WebTestRunner::AccessibilityUIElementList::createRoot):
     21        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:
     22        (AccessibilityUIElementList):
     23        * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp:
     24        (WebTestRunner::CppBoundClass::~CppBoundClass):
     25        (WebTestRunner::CppBoundClass::invoke):
     26        (WebTestRunner::CppBoundClass::getProperty):
     27        (WebTestRunner::CppBoundClass::setProperty):
     28        (WebTestRunner::CppBoundClass::bindCallback):
     29        (WebTestRunner::CppBoundClass::bindGetterCallback):
     30        (WebTestRunner::CppBoundClass::bindProperty):
     31        (WebTestRunner::CppBoundClass::getAsCppVariant):
     32        * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h:
     33        (WebTestRunner):
     34        (CppBoundClass):
     35        (WebTestRunner::CppBoundClass::bindProperty):
     36        (WebTestRunner::CppBoundClass::bindFallbackCallback):
     37        (WebTestRunner::CppBoundClass::bindFallbackMethod):
     38        * DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp:
     39        (WebTestRunner::CppVariant::toString):
     40        (WebTestRunner::CppVariant::toInt32):
     41        (WebTestRunner::CppVariant::toDouble):
     42        (WebTestRunner::CppVariant::toBoolean):
     43        (WebTestRunner::CppVariant::toStringVector):
     44        (WebTestRunner::CppVariant::invoke):
     45        (WebTestRunner::CppVariant::invokeDefault):
     46        * DumpRenderTree/chromium/TestRunner/src/CppVariant.h:
     47        (CppVariant):
     48        * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:
     49        (WebTestRunner):
     50        (WebTestRunner::EventSender::EventSender):
     51        (WebTestRunner::EventSender::reset):
     52        (WebTestRunner::EventSender::mouseDown):
     53        (WebTestRunner::EventSender::mouseUp):
     54        (WebTestRunner::EventSender::mouseMoveTo):
     55        (WebTestRunner::EventSender::keyDown):
     56        (WebTestRunner::EventSender::dispatchMessage):
     57        (WebTestRunner::EventSender::leapForward):
     58        (WebTestRunner::EventSender::replaySavedEvents):
     59        (WebTestRunner::makeMenuItemStringsFor):
     60        (WebTestRunner::EventSender::contextClick):
     61        (WebTestRunner::EventSender::beginDragWithFiles):
     62        (WebTestRunner::EventSender::addTouchPoint):
     63        (WebTestRunner::EventSender::releaseTouchPoint):
     64        (WebTestRunner::EventSender::updateTouchPoint):
     65        (WebTestRunner::EventSender::cancelTouchPoint):
     66        (WebTestRunner::EventSender::sendCurrentTouchEvent):
     67        (WebTestRunner::EventSender::gestureEvent):
     68        * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp:
     69        (WebTestRunner::NativeKeyCodeForWindowsKeyCode):
     70        * DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.cpp:
     71        (WebTestRunner::MockGrammarCheck::checkGrammarOfString):
     72        (WebTestRunner):
     73        * DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.h:
     74        (WebTestRunner):
     75        (MockGrammarCheck):
     76        * DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp:
     77        (WebTestRunner::MockSpellCheck::spellCheckWord):
     78        (WebTestRunner::MockSpellCheck::initializeIfNeeded):
     79        (WebTestRunner):
     80        * DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h:
     81        (MockSpellCheck):
     82        * DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp:
     83        (WebTestRunner::SpellCheckClient::checkTextOfParagraph):
     84        (WebTestRunner::SpellCheckClient::finishLastTextCheck):
     85        * DumpRenderTree/chromium/TestRunner/src/TestCommon.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h.
     86        (isASCIIAlpha):
     87        (isNotASCIIAlpha):
     88        * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
     89        (WebTestRunner::TestInterfaces::TestInterfaces):
     90        * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:
     91        (TestInterfaces):
     92        * DumpRenderTree/chromium/TestRunner/src/TestPlugin.cpp:
     93        (WebTestRunner::TestPlugin::TestPlugin):
     94        (WebTestRunner::TestPlugin::initialize):
     95        (WebTestRunner::TestPlugin::destroy):
     96        (WebTestRunner::TestPlugin::parsePrimitive):
     97        (WebTestRunner::TestPlugin::parseColor):
     98        (WebTestRunner::TestPlugin::initProgram):
     99        (WebTestRunner::TestPlugin::initPrimitive):
     100        (WebTestRunner::TestPlugin::drawPrimitive):
     101        (WebTestRunner::TestPlugin::loadShader):
     102        (WebTestRunner::TestPlugin::loadProgram):
     103        (WebTestRunner::TestPlugin::handleDragStatusUpdate):
     104        * DumpRenderTree/chromium/TestRunner/src/TestPlugin.h:
     105        (TestPlugin):
     106        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
     107        (WebTestRunner::TestRunner::WorkQueue::processWorkSoon):
     108        (WebTestRunner::TestRunner::WorkQueue::processWork):
     109        (WebTestRunner::TestRunner::WorkQueue::reset):
     110        (WebTestRunner::TestRunner::WorkQueue::addWork):
     111        (WebTestRunner::TestRunner::TestRunner):
     112        (WebTestRunner::TestRunner::reset):
     113        (WebTestRunner::TestRunner::policyDelegateDone):
     114        (WebTestRunner::TestRunner::findString):
     115        (WebTestRunner::TestRunner::setTextSubpixelPositioning):
     116        (WebTestRunner::TestRunner::overridePreference):
     117        (WebTestRunner::TestRunner::deliverWebIntent):
     118        (WebTestRunner::TestRunner::setBackingScaleFactor):
     119        (WebTestRunner::TestRunner::simulateLegacyWebNotificationClick):
     120        (WebTestRunner::TestRunner::setMockSpeechInputDumpRect):
     121        (WebTestRunner::TestRunner::wasMockSpeechRecognitionAborted):
     122        (WebTestRunner::TestRunner::setPointerLockWillFailSynchronously):
     123        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
     124        (WebTestRunner::TestRunner::WorkQueue::isEmpty):
     125        (TestRunner):
     126        * DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp:
     127        (WebTestRunner::TextInputController::markedRange):
     128        (WebTestRunner::TextInputController::selectedRange):
     129        (WebTestRunner::TextInputController::firstRectForCharacterRange):
     130        * DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp:
     131        (WebTestRunner::WebPreferences::reset):
     132        * DumpRenderTree/chromium/TestRunner/src/WebTask.cpp:
     133        (WebTestRunner::WebTaskList::~WebTaskList):
     134        (WebTestRunner::WebTaskList::registerTask):
     135        (WebTestRunner::WebTaskList::unregisterTask):
     136        (WebTestRunner::WebTaskList::revokeAll):
     137        * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp:
     138        (WebTestRunner::WebTestInterfaces::WebTestInterfaces):
     139        (WebTestRunner::WebTestInterfaces::~WebTestInterfaces):
     140        (WebTestRunner::WebTestInterfaces::testInterfaces):
     141        * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
     142        (WebTestRunner::WebTestProxyBase::~WebTestProxyBase):
     143        (WebTestRunner::WebTestProxyBase::spellCheckClient):
     144        (WebTestRunner::WebTestProxyBase::registerIntentService):
     145        (WebTestRunner::WebTestProxyBase::dispatchIntent):
     146        (WebTestRunner::WebTestProxyBase::assignIdentifierToRequest):
     147        * DumpRenderTree/chromium/TestRunner/src/config.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h.
     148
    11492013-02-07  Eunmi Lee  <eunmi15.lee@samsung.com>
    2150
  • trunk/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp

    r142109 r142165  
    8484                'TestRunner_resources',
    8585                '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
    86                 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit_wtf_support',
    8786                '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit_test_support',
    88                 '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
    89                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
    9087            ],
    9188            'include_dirs': [
     
    107104            ],
    108105            'conditions': [
     106                ['inside_chromium_build == 1', {
     107                    'type': '<(component)',
     108                    'conditions': [
     109                        ['component=="shared_library"', {
     110                            'defines': [
     111                                'WEBTESTRUNNER_DLL',
     112                                'WEBTESTRUNNER_IMPLEMENTATION=1',
     113                            ],
     114                            'dependencies': [
     115                                '<(chromium_src_dir)/base/base.gyp:base',
     116                                '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
     117                                '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
     118                            ],
     119                            'direct_dependent_settings': {
     120                                'defines': [
     121                                    'WEBTESTRUNNER_DLL',
     122                                ],
     123                            },
     124                            'export_dependent_settings': [
     125                                '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
     126                                '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
     127                            ],
     128                            'msvs_settings': {
     129                                'VCLinkerTool': {
     130                                    'conditions': [
     131                                        ['incremental_chrome_dll==1', {
     132                                            'UseLibraryDependencyInputs': 'true',
     133                                        }],
     134                                    ],
     135                                },
     136                            },
     137                        }],
     138                    ],
     139                }],
    109140                ['toolkit_uses_gtk == 1', {
    110141                    'defines': [
     
    196227                '<(source_dir)/WebKit/chromium/WebKit.gyp:inspector_resources',
    197228                '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
     229                '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit_wtf_support',
    198230                '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
    199231                '<(chromium_src_dir)/base/base.gyp:test_support_base',
  • trunk/Tools/DumpRenderTree/DumpRenderTree.gypi

    r142109 r142165  
    5858            'chromium/TestRunner/public/WebPreferences.h',
    5959            'chromium/TestRunner/public/WebTask.h',
     60            'chromium/TestRunner/public/WebTestCommon.h',
    6061            'chromium/TestRunner/public/WebTestInterfaces.h',
    6162            'chromium/TestRunner/public/WebTestProxy.h',
     
    8182            'chromium/TestRunner/src/SpellCheckClient.cpp',
    8283            'chromium/TestRunner/src/SpellCheckClient.h',
     84            'chromium/TestRunner/src/TestCommon.h',
    8385            'chromium/TestRunner/src/TestInterfaces.cpp',
    8486            'chromium/TestRunner/src/TestInterfaces.h',
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebPreferences.h

    r142109 r142165  
    3535#include "Platform/chromium/public/WebURL.h"
    3636#include "WebKit/chromium/public/WebSettings.h"
     37#include "WebTestCommon.h"
    3738
    3839namespace WebKit {
     
    4243namespace WebTestRunner {
    4344
    44 struct WebPreferences {
     45struct WEBTESTRUNNER_EXPORT WebPreferences {
    4546    WebKit::WebString standardFontFamily;
    4647    WebKit::WebString fixedFontFamily;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTask.h

    r142109 r142165  
    3232#define WebTask_h
    3333
     34#include "WebTestCommon.h"
     35#include <vector>
     36
    3437namespace WebTestRunner {
    3538
     
    3841// WebTask represents a task which can run by WebTestDelegate::postTask() or
    3942// WebTestDelegate::postDelayedTask().
    40 class WebTask {
     43class WEBTESTRUNNER_EXPORT WebTask {
    4144public:
    4245    explicit WebTask(WebTaskList*);
     
    5255};
    5356
    54 class WebTaskList {
     57class WEBTESTRUNNER_EXPORT WebTaskList {
    5558public:
    5659    WebTaskList();
     
    6164
    6265private:
    63     class Private;
    64     Private* m_private;
     66    std::vector<WebTask*> m_tasks;
    6567};
    6668
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestCommon.h

    r142164 r142165  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    31 #ifndef WebTestInterfaces_h
    32 #define WebTestInterfaces_h
     31#ifndef WebTestCommon_h
     32#define WebTestCommon_h
    3333
    34 namespace WebKit {
    35 class WebFrame;
    36 class WebView;
    37 }
     34// -----------------------------------------------------------------------------
     35// Default configuration
    3836
    39 namespace WebTestRunner {
     37#if !defined(WEBTESTRUNNER_IMPLEMENTATION)
     38#define WEBTESTRUNNER_IMPLEMENTATION 0
     39#endif
    4040
    41 class TestInterfaces;
    42 class WebTestDelegate;
    43 class WebTestRunner;
     41// -----------------------------------------------------------------------------
     42// Exported symbols need to be annotated with WEBTESTRUNNER_EXPORT
    4443
    45 class WebTestInterfaces {
    46 public:
    47     WebTestInterfaces();
    48     ~WebTestInterfaces();
     44#if defined(WEBTESTRUNNER_DLL)
    4945
    50     void setWebView(WebKit::WebView*);
    51     void setDelegate(WebTestDelegate*);
    52     void bindTo(WebKit::WebFrame*);
    53     void resetAll();
    54     void setTestIsRunning(bool);
     46#if defined(WIN32)
     47#if WEBTESTRUNNER_IMPLEMENTATION
     48#define WEBTESTRUNNER_EXPORT __declspec(dllexport)
     49#else
     50#define WEBTESTRUNNER_EXPORT __declspec(dllimport)
     51#endif
    5552
    56     WebKit::WebView* webView() const;
    57     WebTestRunner* testRunner();
     53#else // defined(WIN32)
    5854
    5955#if WEBTESTRUNNER_IMPLEMENTATION
    60     TestInterfaces* testInterfaces();
     56#define WEBTESTRUNNER_EXPORT __attribute__((visibility("default")))
     57#else
     58#define WEBTESTRUNNER_EXPORT
    6159#endif
    6260
    63 private:
    64     TestInterfaces* m_interfaces;
    65 };
     61#endif
    6662
    67 }
     63#else // defined(WEBTESTRUNNER_DLL)
    6864
    69 #endif // WebTestInterfaces_h
     65#define WEBTESTRUNNER_EXPORT
     66
     67#endif
     68
     69#endif // WebTestCommon_h
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h

    r142109 r142165  
    3232#define WebTestInterfaces_h
    3333
     34#include "WebTestCommon.h"
     35#include <memory>
     36
    3437namespace WebKit {
    3538class WebFrame;
     
    4346class WebTestRunner;
    4447
    45 class WebTestInterfaces {
     48class WEBTESTRUNNER_EXPORT WebTestInterfaces {
    4649public:
    4750    WebTestInterfaces();
     
    6265
    6366private:
    64     TestInterfaces* m_interfaces;
     67    std::auto_ptr<TestInterfaces> m_interfaces;
    6568};
    6669
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h

    r142109 r142165  
    4343#include "WebKit/chromium/public/WebTextAffinity.h"
    4444#include "WebKit/chromium/public/WebTextDirection.h"
     45#include "WebTestCommon.h"
    4546#include <map>
     47#include <memory>
    4648#include <string>
    4749
     
    8082class WebTestRunner;
    8183
    82 class WebTestProxyBase {
     84class WEBTESTRUNNER_EXPORT WebTestProxyBase {
    8385public:
    8486    void setInterfaces(WebTestInterfaces*);
     
    166168    WebTestDelegate* m_delegate;
    167169
    168     SpellCheckClient* m_spellcheck;
     170    std::auto_ptr<SpellCheckClient> m_spellcheck;
    169171
    170172    WebKit::WebRect m_paintRect;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp

    r142109 r142165  
    3232#include "AccessibilityUIElementChromium.h"
    3333
     34#include "TestCommon.h"
    3435#include "WebAccessibilityObject.h"
    3536#include <public/WebCString.h>
     
    3738#include <public/WebRect.h>
    3839#include <public/WebString.h>
    39 #include <wtf/Assertions.h>
    40 #include <wtf/StringExtras.h>
    4140
    4241using namespace WebKit;
     
    369368{
    370369
    371     ASSERT(factory);
     370    WEBKIT_ASSERT(factory);
    372371
    373372    //
     
    10261025
    10271026    AccessibilityUIElement* element = new AccessibilityUIElement(object, this);
    1028     m_elements.append(element);
     1027    m_elements.push_back(element);
    10291028    return element;
    10301029}
     
    10331032{
    10341033    AccessibilityUIElement* element = new RootAccessibilityUIElement(object, this);
    1035     m_elements.append(element);
     1034    m_elements.push_back(element);
    10361035    return element;
    10371036}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h

    r142109 r142165  
    3535#include "WebAccessibilityObject.h"
    3636#include <vector>
    37 #include <wtf/Vector.h>
    3837
    3938namespace WebTestRunner {
     
    169168
    170169private:
    171     typedef Vector<AccessibilityUIElement*> ElementList;
     170    typedef std::vector<AccessibilityUIElement*> ElementList;
    172171    ElementList m_elements;
    173172};
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp

    r142109 r142165  
    4343#include "CppBoundClass.h"
    4444
     45#include "TestCommon.h"
    4546#include "WebBindings.h"
    4647#include "WebFrame.h"
     48#include <memory>
    4749#include <public/WebString.h>
    48 #include <wtf/Assertions.h>
    49 #include <wtf/OwnPtr.h>
    5050
    5151using namespace WebKit;
     
    7878class GetterPropertyCallback : public CppBoundClass::PropertyCallback {
    7979public:
    80     GetterPropertyCallback(PassOwnPtr<CppBoundClass::GetterCallback> callback)
     80    GetterPropertyCallback(auto_ptr<CppBoundClass::GetterCallback> callback)
    8181        : m_callback(callback)
    8282    {
     
    9292
    9393private:
    94     OwnPtr<CppBoundClass::GetterCallback> m_callback;
     94    auto_ptr<CppBoundClass::GetterCallback> m_callback;
    9595};
    9696
     
    210210{
    211211    for (MethodList::iterator i = m_methods.begin(); i != m_methods.end(); ++i)
    212         delete i->value;
     212        delete i->second;
    213213
    214214    for (PropertyList::iterator i = m_properties.begin(); i != m_properties.end(); ++i)
    215         delete i->value;
     215        delete i->second;
    216216
    217217    // Unregister ourselves if we were bound to a frame.
     
    244244        callback = m_fallbackCallback.get();
    245245    } else
    246         callback = (*method).value;
     246        callback = (*method).second;
    247247
    248248    // Build a CppArgumentList argument vector from the NPVariants coming in.
     
    267267
    268268    CppVariant cppValue;
    269     if (!callback->value->getValue(&cppValue))
     269    if (!callback->second->getValue(&cppValue))
    270270        return false;
    271271    cppValue.copyToNPVariant(result);
     
    281281    CppVariant cppValue;
    282282    cppValue.set(*value);
    283     return (*callback).value->setValue(cppValue);
     283    return (*callback).second->setValue(cppValue);
    284284}
    285285
     
    289289    MethodList::iterator oldCallback = m_methods.find(ident);
    290290    if (oldCallback != m_methods.end()) {
    291         delete oldCallback->value;
     291        delete oldCallback->second;
    292292        if (!callback) {
    293             m_methods.remove(oldCallback);
     293            m_methods.erase(oldCallback);
    294294            return;
    295295        }
    296296    }
    297297
    298     m_methods.set(ident, callback);
    299 }
    300 
    301 void CppBoundClass::bindGetterCallback(const string& name, PassOwnPtr<GetterCallback> callback)
    302 {
    303     PropertyCallback* propertyCallback = callback ? new GetterPropertyCallback(callback) : 0;
     298    m_methods[ident] = callback;
     299}
     300
     301void CppBoundClass::bindGetterCallback(const string& name, auto_ptr<GetterCallback> callback)
     302{
     303    PropertyCallback* propertyCallback = callback.get() ? new GetterPropertyCallback(callback) : 0;
    304304    bindProperty(name, propertyCallback);
    305305}
     
    316316    PropertyList::iterator oldCallback = m_properties.find(ident);
    317317    if (oldCallback != m_properties.end()) {
    318         delete oldCallback->value;
     318        delete oldCallback->second;
    319319        if (!callback) {
    320             m_properties.remove(oldCallback);
     320            m_properties.erase(oldCallback);
    321321            return;
    322322        }
    323323    }
    324324
    325     m_properties.set(ident, callback);
     325    m_properties[ident] = callback;
    326326}
    327327
     
    345345        WebBindings::releaseObject(npObj); // CppVariant takes the reference.
    346346    }
    347     ASSERT(m_selfVariant.isObject());
     347    WEBKIT_ASSERT(m_selfVariant.isObject());
    348348    return &m_selfVariant;
    349349}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h

    r142109 r142165  
    4545
    4646#include "CppVariant.h"
    47 #include <wtf/HashMap.h>
    48 #include <wtf/Noncopyable.h>
    49 #include <wtf/OwnPtr.h>
    50 #include <wtf/PassOwnPtr.h>
    51 #include <wtf/Vector.h>
     47#include <map>
     48#include <memory>
     49#include <vector>
    5250
    5351namespace WebKit {
     
    5856namespace WebTestRunner {
    5957
    60 typedef Vector<CppVariant> CppArgumentList;
     58typedef std::vector<CppVariant> CppArgumentList;
    6159
    6260// CppBoundClass lets you map Javascript method calls and property accesses
    6361// directly to C++ method calls and CppVariant* variable access.
    6462class CppBoundClass {
    65     WTF_MAKE_NONCOPYABLE(CppBoundClass);
    6663public:
    6764    class PropertyCallback {
     
    165162    // Bind Javascript property |name| to the C++ getter callback |callback|.
    166163    // This can be used to create read-only properties.
    167     void bindGetterCallback(const std::string&, PassOwnPtr<GetterCallback>);
     164    void bindGetterCallback(const std::string&, std::auto_ptr<GetterCallback>);
    168165
    169166    // A wrapper for BindGetterCallback, to simplify the common case of binding a
     
    173170    void bindProperty(const std::string& name, void (T::*method)(CppVariant*))
    174171    {
    175         OwnPtr<GetterCallback> callback = adoptPtr(new MemberGetterCallback<T>(static_cast<T*>(this), method));
    176         bindGetterCallback(name, callback.release());
     172        std::auto_ptr<GetterCallback> callback(new MemberGetterCallback<T>(static_cast<T*>(this), method));
     173        bindGetterCallback(name, callback);
    177174    }
    178175
     
    194191    // fallback always returns true when checked for a method's
    195192    // existence).
    196     void bindFallbackCallback(PassOwnPtr<Callback> fallbackCallback)
     193    void bindFallbackCallback(std::auto_ptr<Callback> fallbackCallback)
    197194    {
    198195        m_fallbackCallback = fallbackCallback;
     
    206203    void bindFallbackMethod(void (T::*method)(const CppArgumentList&, CppVariant*))
    207204    {
    208         if (method) {
    209             OwnPtr<Callback> callback = adoptPtr(new MemberCallback<T>(static_cast<T*>(this), method));
    210             bindFallbackCallback(callback.release());
    211         } else
    212             bindFallbackCallback(nullptr);
     205        if (method)
     206            bindFallbackCallback(std::auto_ptr<Callback>(new MemberCallback<T>(static_cast<T*>(this), method)));
     207        else
     208            bindFallbackCallback(std::auto_ptr<Callback>());
    213209    }
    214210
     
    216212    // but otherwise they should be considered private.
    217213
    218     typedef HashMap<NPIdentifier, PropertyCallback*> PropertyList;
    219     typedef HashMap<NPIdentifier, Callback*> MethodList;
     214    typedef std::map<NPIdentifier, PropertyCallback*> PropertyList;
     215    typedef std::map<NPIdentifier, Callback*> MethodList;
    220216    // These maps associate names with property and method pointers to be
    221217    // exposed to JavaScript.
     
    224220
    225221    // The callback gets invoked when a call is made to an nonexistent method.
    226     OwnPtr<Callback> m_fallbackCallback;
     222    std::auto_ptr<Callback> m_fallbackCallback;
    227223
    228224private:
     
    243239    // be unregistered with V8 when we delete it.
    244240    bool m_boundToFrame;
     241
     242private:
     243    CppBoundClass(CppBoundClass&);
     244    CppBoundClass& operator=(const CppBoundClass&);
    245245};
    246246
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp

    r142109 r142165  
    3232#include "CppVariant.h"
    3333
     34#include "TestCommon.h"
    3435#include "WebBindings.h"
    3536#include <limits>
    36 #include <wtf/Assertions.h>
    37 #include <wtf/StringExtras.h>
    3837
    3938using namespace WebKit;
     
    221220string CppVariant::toString() const
    222221{
    223     ASSERT(isString());
     222    WEBKIT_ASSERT(isString());
    224223    return string(value.stringValue.UTF8Characters,
    225224                  value.stringValue.UTF8Length);
     
    232231    if (isDouble())
    233232        return static_cast<int32_t>(value.doubleValue);
    234     ASSERT_NOT_REACHED();
     233    WEBKIT_ASSERT_NOT_REACHED();
    235234    return 0;
    236235}
     
    242241    if (isDouble())
    243242        return value.doubleValue;
    244     ASSERT_NOT_REACHED();
     243    WEBKIT_ASSERT_NOT_REACHED();
    245244    return 0;
    246245}
     
    248247bool CppVariant::toBoolean() const
    249248{
    250     ASSERT(isBool());
     249    WEBKIT_ASSERT(isBool());
    251250    return value.boolValue;
    252251}
    253252
    254 Vector<string> CppVariant::toStringVector() const
    255 {
    256 
    257     ASSERT(isObject());
    258     Vector<string> stringVector;
     253vector<string> CppVariant::toStringVector() const
     254{
     255
     256    WEBKIT_ASSERT(isObject());
     257    vector<string> stringVector;
    259258    NPObject* npValue = value.objectValue;
    260259    NPIdentifier lengthId = WebBindings::getStringIdentifier("length");
     
    291290            string item(NPVARIANT_TO_STRING(indexValue).UTF8Characters,
    292291                        NPVARIANT_TO_STRING(indexValue).UTF8Length);
    293             stringVector.append(item);
     292            stringVector.push_back(item);
    294293        }
    295294        WebBindings::releaseVariantValue(&indexValue);
     
    301300                        uint32_t argumentCount, CppVariant& result) const
    302301{
    303     ASSERT(isObject());
     302    WEBKIT_ASSERT(isObject());
    304303    NPIdentifier methodName = WebBindings::getStringIdentifier(method.c_str());
    305304    NPObject* npObject = value.objectValue;
     
    315314                               CppVariant& result) const
    316315{
    317     ASSERT(isObject());
     316    WEBKIT_ASSERT(isObject());
    318317    NPObject* npObject = value.objectValue;
    319318    NPVariant r;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h

    r142109 r142165  
    4545#include "WebBindings.h"
    4646#include <string>
    47 #include <wtf/Vector.h>
     47#include <vector>
    4848
    4949namespace WebTestRunner {
     
    121121    // Returns a vector of strings for the specified argument. This is useful
    122122    // for converting a JavaScript array of strings into a vector of strings.
    123     Vector<std::string> toStringVector() const;
     123    std::vector<std::string> toStringVector() const;
    124124
    125125    // Invoke method of the given name on an object with the supplied arguments.
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp

    r142109 r142165  
    4646#include "KeyCodeMapping.h"
    4747#include "MockSpellCheck.h"
     48#include "TestCommon.h"
    4849#include "WebContextMenuData.h"
    4950#include "WebDragOperation.h"
     
    5152#include "WebTouchPoint.h"
    5253#include "WebView.h"
     54#include <deque>
    5355#include <public/WebDragData.h>
    5456#include <public/WebPoint.h>
    5557#include <public/WebString.h>
    5658#include <public/WebVector.h>
    57 #include <wtf/Deque.h>
    58 #include <wtf/StringExtras.h>
    59 
    60 #if OS(WINDOWS)
     59
     60#ifdef WIN32
    6161#include "win/WebInputEventFactory.h"
    6262#endif
     
    9898WebDragOperationsMask currentDragEffectsAllowed;
    9999bool replayingSavedEvents = false;
    100 Deque<SavedEvent> mouseEventQueue;
     100deque<SavedEvent> mouseEventQueue;
    101101int touchModifiers;
    102 Vector<WebTouchPoint> touchPoints;
     102vector<WebTouchPoint> touchPoints;
    103103
    104104// Time and place of the last mouse up event.
     
    156156    const char* characters = modifierName.c_str();
    157157    if (!strcmp(characters, "ctrlKey")
    158 #if !OS(MAC_OS_X)
     158#ifndef __APPLE__
    159159        || !strcmp(characters, "addSelectionKey")
    160160#endif
     
    165165    else if (!strcmp(characters, "altKey")) {
    166166        event->modifiers |= WebInputEvent::AltKey;
    167 #if !OS(MAC_OS_X)
     167#ifndef __APPLE__
    168168        // On Windows all keys with Alt modifier will be marked as system key.
    169169        // We keep the same behavior on Linux and everywhere non-Mac, see:
     
    173173        isSystemKey = true;
    174174#endif
    175 #if OS(MAC_OS_X)
     175#ifdef __APPLE__
    176176    } else if (!strcmp(characters, "metaKey") || !strcmp(characters, "addSelectionKey")) {
    177177        event->modifiers |= WebInputEvent::MetaKey;
     
    192192    bool isSystemKey = false;
    193193    if (argument->isObject()) {
    194         Vector<string> modifiers = argument->toStringVector();
    195         for (Vector<string>::const_iterator i = modifiers.begin(); i != modifiers.end(); ++i)
     194        vector<string> modifiers = argument->toStringVector();
     195        for (vector<string>::const_iterator i = modifiers.begin(); i != modifiers.end(); ++i)
    196196            isSystemKey |= applyKeyModifier(*i, event);
    197197    } else if (argument->isString())
     
    205205bool getEditCommand(const WebKeyboardEvent& event, string* name)
    206206{
    207 #if OS(MAC_OS_X)
     207#ifdef __APPLE__
    208208    // We only cares about Left,Right,Up,Down keys with Command or Command+Shift
    209209    // modifiers. These key events correspond to some special movement and
     
    308308    // events so we can simulate drag & drop.
    309309    bindProperty("dragMode", &dragMode);
    310 #if OS(WINDOWS)
     310#ifdef WIN32
    311311    bindProperty("WM_KEYDOWN", &wmKeyDown);
    312312    bindProperty("WM_KEYUP", &wmKeyUp);
     
    323323{
    324324    // The test should have finished a drag and the mouse button state.
    325     ASSERT(currentDragData.isNull());
     325    WEBKIT_ASSERT(currentDragData.isNull());
    326326    currentDragData.reset();
    327327    currentDragEffect = WebKit::WebDragOperationNone;
     
    329329    pressedButton = WebMouseEvent::ButtonNone;
    330330    dragMode.set(true);
    331 #if OS(WINDOWS)
     331#ifdef WIN32
    332332    wmKeyDown.set(WM_KEYDOWN);
    333333    wmKeyUp.set(WM_KEYUP);
     
    419419
    420420    int buttonNumber = getButtonNumberFromSingleArg(arguments);
    421     ASSERT(buttonNumber != -1);
     421    WEBKIT_ASSERT(buttonNumber != -1);
    422422
    423423    WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber);
     
    441441
    442442    int buttonNumber = getButtonNumberFromSingleArg(arguments);
    443     ASSERT(buttonNumber != -1);
     443    WEBKIT_ASSERT(buttonNumber != -1);
    444444
    445445    WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber);
     
    449449        savedEvent.type = SavedEvent::MouseUp;
    450450        savedEvent.buttonType = buttonType;
    451         mouseEventQueue.append(savedEvent);
     451        mouseEventQueue.push_back(savedEvent);
    452452        replaySavedEvents();
    453453    } else {
     
    506506        savedEvent.type = SavedEvent::MouseMove;
    507507        savedEvent.pos = mousePos;
    508         mouseEventQueue.append(savedEvent);
     508        mouseEventQueue.push_back(savedEvent);
    509509    } else {
    510510        WebMouseEvent event;
     
    599599        if (!code) {
    600600            WebString webCodeStr = WebString::fromUTF8(codeStr.data(), codeStr.size());
    601             ASSERT(webCodeStr.length() == 1);
     601            WEBKIT_ASSERT(webCodeStr.length() == 1);
    602602            text = code = webCodeStr.data()[0];
    603603            needsShiftKeyModifier = needsShiftModifier(code);
     
    617617    eventDown.modifiers = 0;
    618618    eventDown.windowsKeyCode = code;
    619 #if OS(LINUX) && USE(GTK)
     619#if defined(__linux__) && USE(GTK)
    620620    eventDown.nativeKeyCode = NativeKeyCodeForWindowsKeyCode(code);
    621621#endif
     
    679679    result->setNull();
    680680
    681 #if OS(WINDOWS)
     681#ifdef WIN32
    682682    if (arguments.size() == 3) {
    683683        // Grab the message id to see if we need to dispatch it.
     
    695695        webview()->handleInputEvent(WebInputEventFactory::keyboardEvent(0, msg, arguments[1].toInt32(), lparam));
    696696    } else
    697         ASSERT_NOT_REACHED();
     697        WEBKIT_ASSERT_NOT_REACHED();
    698698#endif
    699699}
     
    719719        savedEvent.type = SavedEvent::LeapForward;
    720720        savedEvent.milliseconds = milliseconds;
    721         mouseEventQueue.append(savedEvent);
     721        mouseEventQueue.push_back(savedEvent);
    722722    } else
    723723        doLeapForward(milliseconds);
     
    780780{
    781781    replayingSavedEvents = true;
    782     while (!mouseEventQueue.isEmpty()) {
    783         SavedEvent e = mouseEventQueue.takeFirst();
     782    while (!mouseEventQueue.empty()) {
     783        SavedEvent e = mouseEventQueue.front();
     784        mouseEventQueue.pop_front();
    784785
    785786        switch (e.type) {
     
    800801        }
    801802        default:
    802             ASSERT_NOT_REACHED();
     803            WEBKIT_ASSERT_NOT_REACHED();
    803804        }
    804805    }
     
    814815// - Some test even checks actual string content. So providing it would be also helpful.
    815816//
    816 static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, WebTestDelegate* delegate)
     817static vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, WebTestDelegate* delegate)
    817818{
    818819    // These constants are based on Safari's context menu because tests are made for it.
     
    822823    // This is possible because mouse events are cancelleable.
    823824    if (!contextMenu)
    824         return Vector<WebString>();
    825 
    826     Vector<WebString> strings;
     825        return vector<WebString>();
     826
     827    vector<WebString> strings;
    827828
    828829    if (contextMenu->isEditable) {
    829830        for (const char** item = editableMenuStrings; *item; ++item)
    830             strings.append(WebString::fromUTF8(*item));
     831            strings.push_back(WebString::fromUTF8(*item));
    831832        WebVector<WebString> suggestions;
    832833        MockSpellCheck::fillSuggestionList(contextMenu->misspelledWord, &suggestions);
    833834        for (size_t i = 0; i < suggestions.size(); ++i)
    834             strings.append(suggestions[i]);
     835            strings.push_back(suggestions[i]);
    835836    } else {
    836837        for (const char** item = nonEditableMenuStrings; *item; ++item)
    837             strings.append(WebString::fromUTF8(*item));
     838            strings.push_back(WebString::fromUTF8(*item));
    838839    }
    839840
     
    860861    webview()->handleInputEvent(event);
    861862
    862 #if OS(WINDOWS)
     863#ifdef WIN32
    863864    initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event, getCurrentEventTimeSec(m_delegate));
    864865    webview()->handleInputEvent(event);
     
    917918{
    918919    currentDragData.initialize();
    919     Vector<string> files = arguments[0].toStringVector();
     920    vector<string> files = arguments[0].toStringVector();
    920921    WebVector<WebString> absoluteFilenames(files.size());
    921922    for (size_t i = 0; i < files.size(); ++i) {
     
    956957    }
    957958    touchPoint.id = lowestId;
    958     touchPoints.append(touchPoint);
     959    touchPoints.push_back(touchPoint);
    959960}
    960961
     
    970971
    971972    const unsigned index = arguments[0].toInt32();
    972     ASSERT(index < touchPoints.size());
     973    WEBKIT_ASSERT(index < touchPoints.size());
    973974
    974975    WebTouchPoint* touchPoint = &touchPoints[index];
     
    10021003
    10031004    const unsigned index = arguments[0].toInt32();
    1004     ASSERT(index < touchPoints.size());
     1005    WEBKIT_ASSERT(index < touchPoints.size());
    10051006
    10061007    WebPoint position(arguments[1].toInt32(), arguments[2].toInt32());
     
    10161017
    10171018    const unsigned index = arguments[0].toInt32();
    1018     ASSERT(index < touchPoints.size());
     1019    WEBKIT_ASSERT(index < touchPoints.size());
    10191020
    10201021    WebTouchPoint* touchPoint = &touchPoints[index];
     
    10241025void EventSender::sendCurrentTouchEvent(const WebInputEvent::Type type)
    10251026{
    1026     ASSERT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap) > touchPoints.size());
     1027    WEBKIT_ASSERT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap) > touchPoints.size());
    10271028    webview()->layout();
    10281029
     
    10391040        WebTouchPoint* touchPoint = &touchPoints[i];
    10401041        if (touchPoint->state == WebTouchPoint::StateReleased) {
    1041             touchPoints.remove(i);
     1042            touchPoints.erase(touchPoints.begin() + i);
    10421043            --i;
    10431044        } else
     
    12661267        break;
    12671268    default:
    1268         ASSERT_NOT_REACHED();
     1269        WEBKIT_ASSERT_NOT_REACHED();
    12691270    }
    12701271
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp

    r142109 r142165  
    3232#include "KeyCodeMapping.h"
    3333
    34 #include <wtf/UnusedParam.h>
    35 
    3634namespace WebTestRunner {
    3735
    3836int NativeKeyCodeForWindowsKeyCode(int keysym)
    3937{
    40 #if OS(LINUX) && USE(GTK)
     38#if defined(__linux__) && USE(GTK)
    4139    // See /usr/share/X11/xkb/keycodes/*
    4240    static const int asciiToKeyCode[] = {
     
    241239    }
    242240#else
    243     UNUSED_PARAM(keysym);
    244     return 0;
     241    return keysym - keysym;
    245242#endif
    246243}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.cpp

    r142109 r142165  
    3232#include "MockGrammarCheck.h"
    3333
     34#include "Platform/chromium/public/WebCString.h"
    3435#include "Platform/chromium/public/WebString.h"
     36#include "TestCommon.h"
    3537#include "WebTextCheckingResult.h"
    36 
    37 #include <wtf/ASCIICType.h>
    38 #include <wtf/Assertions.h>
    39 #include <wtf/text/WTFString.h>
     38#include <algorithm>
    4039
    4140using namespace WebKit;
     41using namespace std;
    4242
    43 bool MockGrammarCheck::checkGrammarOfString(const WebString& text, Vector<WebTextCheckingResult>* results)
     43namespace WebTestRunner {
     44
     45bool MockGrammarCheck::checkGrammarOfString(const WebString& text, vector<WebTextCheckingResult>* results)
    4446{
    45     ASSERT(results);
    46     WTF::String stringText(text.data(), text.length());
    47     if (stringText.find(isASCIIAlpha) == static_cast<size_t>(-1))
     47    WEBKIT_ASSERT(results);
     48    string16 stringText = text;
     49    if (find_if(stringText.begin(), stringText.end(), isASCIIAlpha) == stringText.end())
    4850        return true;
    4951
     
    7072    for (size_t i = 0; i < ARRAYSIZE_UNSAFE(grammarErrors); ++i) {
    7173        int offset = 0;
    72         while ((offset = stringText.find(grammarErrors[i].text, offset)) != -1) {
    73             results->append(WebTextCheckingResult(WebTextCheckingTypeGrammar, offset + grammarErrors[i].location, grammarErrors[i].length));
     74        string16 error(grammarErrors[i].text, grammarErrors[i].text + strlen(grammarErrors[i].text));
     75        while ((offset = stringText.find(error, offset)) != string16::npos) {
     76            results->push_back(WebTextCheckingResult(WebTextCheckingTypeGrammar, offset + grammarErrors[i].location, grammarErrors[i].length));
    7477            offset += grammarErrors[i].length;
    7578        }
     
    7780    return false;
    7881}
     82
     83}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.h

    r142109 r142165  
    3232#define MockGrammarCheck_h
    3333
    34 #include <wtf/Vector.h>
    35 #include <wtf/text/WTFString.h>
     34#include <vector>
    3635
    3736namespace WebKit {
     
    4241}
    4342
     43namespace WebTestRunner {
     44
    4445// A mock implementation of a grammar-checker used for WebKit tests. This class
    4546// only implements the minimal functionarities required by WebKit tests, i.e.
     
    4950class MockGrammarCheck {
    5051public:
    51     static bool checkGrammarOfString(const WebKit::WebString&, Vector<WebKit::WebTextCheckingResult>*);
     52    static bool checkGrammarOfString(const WebKit::WebString&, std::vector<WebKit::WebTextCheckingResult>*);
    5253};
    5354
     55}
     56
    5457#endif // MockSpellCheck_h
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp

    r142109 r142165  
    3232#include "MockSpellCheck.h"
    3333
    34 #include <wtf/ASCIICType.h>
    35 #include <wtf/Assertions.h>
    36 #include <wtf/text/WTFString.h>
     34#include "TestCommon.h"
     35#include <public/WebCString.h>
    3736
    3837using namespace WebKit;
     38using namespace std;
    3939
    40 static void append(WebVector<WebString>* data, const WebString& item)
     40namespace WebTestRunner {
     41
     42namespace {
     43
     44void append(WebVector<WebString>* data, const WebString& item)
    4145{
    4246    WebVector<WebString> result(data->size() + 1);
     
    4751}
    4852
     53}
     54
    4955MockSpellCheck::MockSpellCheck()
    5056    : m_initialized(false) { }
     
    5258MockSpellCheck::~MockSpellCheck() { }
    5359
    54 static bool isNotASCIIAlpha(UChar ch) { return !isASCIIAlpha(ch); }
    55 
    5660bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset, int* misspelledLength)
    5761{
    58     ASSERT(misspelledOffset);
    59     ASSERT(misspelledLength);
     62    WEBKIT_ASSERT(misspelledOffset);
     63    WEBKIT_ASSERT(misspelledLength);
    6064
    6165    // Initialize this spellchecker.
     
    6670    *misspelledLength = 0;
    6771
    68     // Convert to a String because we store String instances in
     72    // Convert to a string16 because we store string16 instances in
    6973    // m_misspelledWords and WebString has no find().
    70     String stringText(text.data(), text.length());
     74    string16 stringText = text;
    7175    int skippedLength = 0;
    7276
    73     while (!stringText.isEmpty()) {
     77    while (!stringText.empty()) {
    7478        // Extract the first possible English word from the given string.
    7579        // The given string may include non-ASCII characters or numbers. So, we
     
    7983        // If the given string doesn't include any ASCII characters, we can treat the
    8084        // string as valid one.
    81         int wordOffset = stringText.find(isASCIIAlpha);
    82         if (wordOffset == -1)
     85        string16::iterator firstChar = find_if(stringText.begin(), stringText.end(), isASCIIAlpha);
     86        if (firstChar == stringText.end())
    8387            return true;
     88        int wordOffset = distance(stringText.begin(), firstChar);
    8489        int maxWordLength = static_cast<int>(stringText.length()) - wordOffset;
    8590        int wordLength;
    86         String word;
     91        string16 word;
    8792
    8893        // Look up our misspelled-word table to check if the extracted word is a
     
    9398        for (size_t i = 0; i < m_misspelledWords.size(); ++i) {
    9499            wordLength = static_cast<int>(m_misspelledWords.at(i).length()) > maxWordLength ? maxWordLength : static_cast<int>(m_misspelledWords.at(i).length());
    95             word = stringText.substring(wordOffset, wordLength);
     100            word = stringText.substr(wordOffset, wordLength);
    96101            if (word == m_misspelledWords.at(i) && (static_cast<int>(stringText.length()) == wordOffset + wordLength || isNotASCIIAlpha(stringText[wordOffset + wordLength]))) {
    97102                *misspelledOffset = wordOffset + skippedLength;
     
    104109            break;
    105110
    106         int wordEnd = stringText.find(isNotASCIIAlpha, wordOffset);
    107         wordLength = wordEnd == -1 ? static_cast<int>(stringText.length()) - wordOffset : wordEnd - wordOffset;
     111        string16::iterator lastChar = find_if(stringText.begin() + wordOffset, stringText.end(), isNotASCIIAlpha);
     112        if (lastChar == stringText.end())
     113            wordLength = static_cast<int>(stringText.length()) - wordOffset;
     114        else
     115            wordLength = distance(firstChar, lastChar);
    108116
    109         ASSERT(0 < wordOffset + wordLength);
    110         stringText = stringText.substring(wordOffset + wordLength);
     117        WEBKIT_ASSERT(0 < wordOffset + wordLength);
     118        stringText = stringText.substr(wordOffset + wordLength);
    111119        skippedLength += wordOffset + wordLength;
    112120    }
     
    171179    m_misspelledWords.clear();
    172180    for (size_t i = 0; i < arraysize(misspelledWords); ++i)
    173         m_misspelledWords.append(String::fromUTF8(misspelledWords[i]));
     181        m_misspelledWords.push_back(string16(misspelledWords[i], misspelledWords[i] + strlen(misspelledWords[i])));
    174182
    175183    // Mark as initialized to prevent this object from being initialized twice
     
    181189    return false;
    182190}
     191
     192}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h

    r142109 r142165  
    3434#include "Platform/chromium/public/WebString.h"
    3535#include "Platform/chromium/public/WebVector.h"
    36 #include <wtf/Vector.h>
    37 #include <wtf/text/WTFString.h>
     36#include <vector>
     37
     38namespace WebTestRunner {
    3839
    3940// A mock implementation of a spell-checker used for WebKit tests.
     
    7172
    7273    // A table that consists of misspelled words.
    73     Vector<String> m_misspelledWords;
     74    std::vector<string16> m_misspelledWords;
    7475
    7576    // A flag representing whether or not this object is initialized.
     
    7778};
    7879
     80}
     81
    7982#endif // MockSpellCheck_h
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp

    r142109 r142165  
    3838
    3939using namespace WebKit;
     40using namespace std;
    4041
    4142namespace WebTestRunner {
     
    8283void SpellCheckClient::checkTextOfParagraph(const WebString& text, WebTextCheckingTypeMask mask, WebVector<WebTextCheckingResult>* webResults)
    8384{
    84     Vector<WebTextCheckingResult> results;
     85    vector<WebTextCheckingResult> results;
    8586    if (mask & WebTextCheckingTypeSpelling) {
    8687        size_t offset = 0;
     
    9798            result.location = offset + misspelledPosition;
    9899            result.length = misspelledLength;
    99             results.append(result);
     100            results.push_back(result);
    100101            offset += misspelledPosition + misspelledLength;
    101102        }
     
    121122void SpellCheckClient::finishLastTextCheck()
    122123{
    123     Vector<WebTextCheckingResult> results;
     124    vector<WebTextCheckingResult> results;
    124125    int offset = 0;
    125     String text(m_lastRequestedTextCheckString.data(), m_lastRequestedTextCheckString.length());
     126    string16 text = m_lastRequestedTextCheckString;
    126127    while (text.length()) {
    127128        int misspelledPosition = 0;
    128129        int misspelledLength = 0;
    129         m_spellcheck.spellCheckWord(WebString(text.characters(), text.length()), &misspelledPosition, &misspelledLength);
     130        m_spellcheck.spellCheckWord(WebString(text), &misspelledPosition, &misspelledLength);
    130131        if (!misspelledLength)
    131132            break;
    132133        WebVector<WebString> suggestions;
    133         m_spellcheck.fillSuggestionList(WebString(text.characters() + misspelledPosition, misspelledLength), &suggestions);
    134         results.append(WebTextCheckingResult(WebTextCheckingTypeSpelling, offset + misspelledPosition, misspelledLength, suggestions.isEmpty() ? WebString() : suggestions[0]));
    135         text = text.substring(misspelledPosition + misspelledLength);
     134        m_spellcheck.fillSuggestionList(WebString(text.substr(misspelledPosition, misspelledLength)), &suggestions);
     135        results.push_back(WebTextCheckingResult(WebTextCheckingTypeSpelling, offset + misspelledPosition, misspelledLength, suggestions.isEmpty() ? WebString() : suggestions[0]));
     136        text = text.substr(misspelledPosition + misspelledLength);
    136137        offset += misspelledPosition + misspelledLength;
    137138    }
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestCommon.h

    r142164 r142165  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    31 #ifndef WebTestInterfaces_h
    32 #define WebTestInterfaces_h
     31#ifndef TestCommon_h
     32#define TestCommon_h
    3333
    34 namespace WebKit {
    35 class WebFrame;
    36 class WebView;
    37 }
     34#include <base/compiler_specific.h>
     35#include <public/WebCommon.h>
     36#include <stdio.h>
    3837
    39 namespace WebTestRunner {
    40 
    41 class TestInterfaces;
    42 class WebTestDelegate;
    43 class WebTestRunner;
    44 
    45 class WebTestInterfaces {
    46 public:
    47     WebTestInterfaces();
    48     ~WebTestInterfaces();
    49 
    50     void setWebView(WebKit::WebView*);
    51     void setDelegate(WebTestDelegate*);
    52     void bindTo(WebKit::WebFrame*);
    53     void resetAll();
    54     void setTestIsRunning(bool);
    55 
    56     WebKit::WebView* webView() const;
    57     WebTestRunner* testRunner();
    58 
    59 #if WEBTESTRUNNER_IMPLEMENTATION
    60     TestInterfaces* testInterfaces();
     38#if defined(WIN32)
     39#define snprintf(str, size, ...) _snprintf_s(str, size, size, __VA_ARGS__)
    6140#endif
    6241
    63 private:
    64     TestInterfaces* m_interfaces;
    65 };
     42inline bool isASCIIAlpha(char ch) { return (ch | 0x20) >= 'a' && (ch | 0x20) <= 'z'; }
    6643
    67 }
     44inline bool isNotASCIIAlpha(char ch) { return !isASCIIAlpha(ch); }
    6845
    69 #endif // WebTestInterfaces_h
     46#endif // TestCommon_h
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp

    r142109 r142165  
    4646
    4747TestInterfaces::TestInterfaces()
    48     : m_webView(0)
     48    : m_accessibilityController(new AccessibilityController())
     49    , m_eventSender(new EventSender())
     50    , m_gamepadController(new GamepadController())
     51    , m_textInputController(new TextInputController())
     52    , m_testRunner(new TestRunner())
     53    , m_webView(0)
    4954{
    50     m_accessibilityController = adoptPtr(new AccessibilityController());
    51     m_eventSender = adoptPtr(new EventSender());
    52     m_gamepadController = adoptPtr(new GamepadController());
    53     m_textInputController = adoptPtr(new TextInputController());
    54     m_testRunner = adoptPtr(new TestRunner());
    5555}
    5656
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h

    r142109 r142165  
    3232#define TestInterfaces_h
    3333
    34 #include <wtf/OwnPtr.h>
     34#include <memory>
    3535
    3636namespace WebKit {
     
    6666
    6767private:
    68     OwnPtr<AccessibilityController> m_accessibilityController;
    69     OwnPtr<EventSender> m_eventSender;
    70     OwnPtr<GamepadController> m_gamepadController;
    71     OwnPtr<TextInputController> m_textInputController;
    72     OwnPtr<TestRunner> m_testRunner;
     68    std::auto_ptr<AccessibilityController> m_accessibilityController;
     69    std::auto_ptr<EventSender> m_eventSender;
     70    std::auto_ptr<GamepadController> m_gamepadController;
     71    std::auto_ptr<TextInputController> m_textInputController;
     72    std::auto_ptr<TestRunner> m_testRunner;
    7373    WebKit::WebView* m_webView;
    7474};
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestPlugin.cpp

    r142109 r142165  
    2727#include "TestPlugin.h"
    2828
     29#include "TestCommon.h"
    2930#include "WebFrame.h"
    3031#include "WebInputEvent.h"
     
    3637#include <public/WebCompositorSupport.h>
    3738#include <public/WebGraphicsContext3D.h>
    38 #include <wtf/Assertions.h>
    39 #include <wtf/PassOwnPtr.h>
    40 #include <wtf/StringExtras.h>
    41 #include <wtf/text/CString.h>
    4239
    4340using namespace WebKit;
     41using namespace std;
    4442
    4543namespace WebTestRunner {
     
    10098    }
    10199
    102     ASSERT_NOT_REACHED();
     100    WEBKIT_ASSERT_NOT_REACHED();
    103101    return 0;
    104102}
     
    135133WebPluginContainer::TouchEventRequestType parseTouchEventRequestType(const WebString& string)
    136134{
    137     DEFINE_STATIC_LOCAL(const WebString, kPrimitiveRaw, (WebString::fromUTF8("raw")));
    138     DEFINE_STATIC_LOCAL(const WebString, kPrimitiveSynthetic, (WebString::fromUTF8("synthetic")));
    139 
    140     if (string == kPrimitiveRaw)
     135    if (string == WebString::fromUTF8("raw"))
    141136        return WebPluginContainer::TouchEventRequestTypeRaw;
    142     if (string == kPrimitiveSynthetic)
     137    if (string == WebString::fromUTF8("synthetic"))
    143138        return WebPluginContainer::TouchEventRequestTypeSynthesizedMouse;
    144139    return WebPluginContainer::TouchEventRequestTypeNone;
     
    169164    static const WebString kAttributePrintUserGestureStatus = WebString::fromUTF8("print-user-gesture-status");
    170165
    171     ASSERT(params.attributeNames.size() == params.attributeValues.size());
     166    WEBKIT_ASSERT(params.attributeNames.size() == params.attributeValues.size());
    172167    size_t size = params.attributeNames.size();
    173168    for (size_t i = 0; i < size; ++i) {
     
    213208        return false;
    214209
    215     m_layer = adoptPtr(Platform::current()->compositorSupport()->createExternalTextureLayer(this));
     210    m_layer = auto_ptr<WebExternalTextureLayer>(Platform::current()->compositorSupport()->createExternalTextureLayer(this));
    216211    m_container = container;
    217212    m_container->setWebLayer(m_layer->layer());
     
    229224    if (m_container)
    230225        m_container->setWebLayer(0);
    231     m_layer.clear();
     226    m_layer.reset();
    232227    destroyScene();
    233228
     
    276271        primitive = PrimitiveTriangle;
    277272    else
    278         ASSERT_NOT_REACHED();
     273        WEBKIT_ASSERT_NOT_REACHED();
    279274    return primitive;
    280275}
     
    295290        color[2] = 255;
    296291    else
    297         ASSERT_NOT_REACHED();
     292        WEBKIT_ASSERT_NOT_REACHED();
    298293}
    299294
     
    362357bool TestPlugin::initProgram()
    363358{
    364     const CString vertexSource(
     359    const string vertexSource(
    365360        "attribute vec4 position;  \n"
    366361        "void main() {             \n"
     
    369364    );
    370365
    371     const CString fragmentSource(
     366    const string fragmentSource(
    372367        "precision mediump float; \n"
    373368        "uniform vec4 color;      \n"
     
    388383bool TestPlugin::initPrimitive()
    389384{
    390     ASSERT(m_scene.primitive == PrimitiveTriangle);
     385    WEBKIT_ASSERT(m_scene.primitive == PrimitiveTriangle);
    391386
    392387    m_scene.vbo = m_context->createBuffer();
     
    406401void TestPlugin::drawPrimitive()
    407402{
    408     ASSERT(m_scene.primitive == PrimitiveTriangle);
    409     ASSERT(m_scene.vbo);
    410     ASSERT(m_scene.program);
     403    WEBKIT_ASSERT(m_scene.primitive == PrimitiveTriangle);
     404    WEBKIT_ASSERT(m_scene.vbo);
     405    WEBKIT_ASSERT(m_scene.program);
    411406
    412407    m_context->useProgram(m_scene.program);
     
    424419}
    425420
    426 unsigned TestPlugin::loadShader(unsigned type, const CString& source)
     421unsigned TestPlugin::loadShader(unsigned type, const string& source)
    427422{
    428423    unsigned shader = m_context->createShader(type);
     
    441436}
    442437
    443 unsigned TestPlugin::loadProgram(const CString& vertexSource, const CString& fragmentSource)
     438unsigned TestPlugin::loadProgram(const string& vertexSource, const string& fragmentSource)
    444439{
    445440    unsigned vertexShader = loadShader(GL_VERTEX_SHADER, vertexSource);
     
    534529        break;
    535530    case WebDragStatusUnknown:
    536         ASSERT_NOT_REACHED();
     531        WEBKIT_ASSERT_NOT_REACHED();
    537532    }
    538533    m_delegate->printMessage(std::string("Plugin received event: ") + dragStatusName + "\n");
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestPlugin.h

    r142109 r142165  
    2929#include "WebPlugin.h"
    3030#include "WebPluginContainer.h"
     31#include <memory>
    3132#include <public/WebExternalTextureLayer.h>
    3233#include <public/WebExternalTextureLayerClient.h>
    33 #include <wtf/OwnPtr.h>
     34#include <string>
    3435
    3536namespace WebTestRunner {
     
    125126    bool initPrimitive();
    126127    void drawPrimitive();
    127     unsigned loadShader(unsigned type, const WTF::CString& source);
    128     unsigned loadProgram(const WTF::CString& vertexSource, const WTF::CString& fragmentSource);
     128    unsigned loadShader(unsigned type, const std::string& source);
     129    unsigned loadProgram(const std::string& vertexSource, const std::string& fragmentSource);
    129130
    130131    WebKit::WebFrame* m_frame;
     
    137138    unsigned m_framebuffer;
    138139    Scene m_scene;
    139     OwnPtr<WebKit::WebExternalTextureLayer> m_layer;
     140    std::auto_ptr<WebKit::WebExternalTextureLayer> m_layer;
    140141
    141142    WebKit::WebPluginContainer::TouchEventRequestType m_touchEventRequest;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp

    r142109 r142165  
    5656#include "WebWorkerInfo.h"
    5757#include "v8/include/v8.h"
     58#include <limits>
     59#include <memory>
    5860#include <public/WebData.h>
    5961#include <public/WebPoint.h>
    60 #include <wtf/OwnArrayPtr.h>
    61 #include <wtf/text/WTFString.h>
    62 
    63 #if OS(LINUX) || OS(ANDROID)
     62
     63#if defined(__linux__) || defined(ANDROID)
    6464#include "linux/WebFontRendering.h"
    6565#endif
     
    8484class InvokeCallbackTask : public WebMethodTask<TestRunner> {
    8585public:
    86     InvokeCallbackTask(TestRunner* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments)
     86    InvokeCallbackTask(TestRunner* object, auto_ptr<CppVariant> callbackArguments)
    8787        : WebMethodTask<TestRunner>(object)
    8888        , m_callbackArguments(callbackArguments)
    89         , m_numberOfArguments(numberOfArguments)
    9089    {
    9190    }
     
    9493    {
    9594        CppVariant invokeResult;
    96         m_callbackArguments[0].invokeDefault(m_callbackArguments.get(), m_numberOfArguments, invokeResult);
     95        m_callbackArguments->invokeDefault(m_callbackArguments.get(), 1, invokeResult);
    9796    }
    9897
    9998private:
    100     OwnArrayPtr<CppVariant> m_callbackArguments;
    101     uint32_t m_numberOfArguments;
     99    auto_ptr<CppVariant> m_callbackArguments;
    102100};
    103101
     
    114112        return;
    115113
    116     if (!m_queue.isEmpty()) {
     114    if (!m_queue.empty()) {
    117115        // We delay processing queued work to avoid recursion problems.
    118116        m_controller->m_delegate->postTask(new WorkQueueTask(this));
     
    124122{
    125123    // Quit doing work once a load is in progress.
    126     while (!m_queue.isEmpty()) {
    127         bool startedLoad = m_queue.first()->run(m_controller->m_delegate, m_controller->m_webView);
    128         delete m_queue.takeFirst();
     124    while (!m_queue.empty()) {
     125        bool startedLoad = m_queue.front()->run(m_controller->m_delegate, m_controller->m_webView);
     126        delete m_queue.front();
     127        m_queue.pop_front();
    129128        if (startedLoad)
    130129            return;
     
    138137{
    139138    m_frozen = false;
    140     while (!m_queue.isEmpty())
    141         delete m_queue.takeFirst();
     139    while (!m_queue.empty()) {
     140        delete m_queue.front();
     141        m_queue.pop_front();
     142    }
    142143}
    143144
     
    148149        return;
    149150    }
    150     m_queue.append(work);
     151    m_queue.push_back(work);
    151152}
    152153
     
    157158    , m_delegate(0)
    158159    , m_webView(0)
    159     , m_intentClient(adoptPtr(new EmptyWebDeliveredIntentClient))
    160     , m_webPermissions(adoptPtr(new WebPermissions))
     160    , m_intentClient(new EmptyWebDeliveredIntentClient)
     161    , m_webPermissions(new WebPermissions)
    161162{
    162163    // Initialize the map that associates methods of this class with the names
     
    216217    bindMethod("setSelectTrailingWhitespaceEnabled", &TestRunner::setSelectTrailingWhitespaceEnabled);
    217218    bindMethod("setMockDeviceOrientation", &TestRunner::setMockDeviceOrientation);
    218 #if ENABLE(POINTER_LOCK)
    219219    bindMethod("didAcquirePointerLock", &TestRunner::didAcquirePointerLock);
    220220    bindMethod("didLosePointerLock", &TestRunner::didLosePointerLock);
     
    222222    bindMethod("setPointerLockWillRespondAsynchronously", &TestRunner::setPointerLockWillRespondAsynchronously);
    223223    bindMethod("setPointerLockWillFailSynchronously", &TestRunner::setPointerLockWillFailSynchronously);
    224 #endif
    225224
    226225    // The following modify WebPreferences.
     
    274273    bindMethod("setWillSendRequestReturnsNullOnRedirect", &TestRunner::setWillSendRequestReturnsNullOnRedirect);
    275274
    276 #if ENABLE(WEB_INTENTS)
    277275    // The following methods interact with the WebTestProxy.
     276#if ENABLE_WEB_INTENTS
    278277    bindMethod("sendWebIntentResponse", &TestRunner::sendWebIntentResponse);
    279278    bindMethod("deliverWebIntent", &TestRunner::deliverWebIntent);
     
    295294    bindMethod("setMockGeolocationPositionUnavailableError", &TestRunner::setMockGeolocationPositionUnavailableError);
    296295    bindMethod("setMockGeolocationPosition", &TestRunner::setMockGeolocationPosition);
    297 #if ENABLE(NOTIFICATIONS)
    298296    bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificationPermission);
    299297    bindMethod("simulateLegacyWebNotificationClick", &TestRunner::simulateLegacyWebNotificationClick);
    300 #endif
    301 #if ENABLE(INPUT_SPEECH)
    302298    bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult);
    303299    bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDumpRect);
    304 #endif
    305 #if ENABLE(SCRIPTED_SPEECH)
    306300    bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecognitionResult);
    307301    bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecognitionError);
    308302    bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechRecognitionAborted);
    309 #endif
    310303    bindMethod("display", &TestRunner::display);
    311304    bindMethod("displayInvalidatedRegion", &TestRunner::displayInvalidatedRegion);
     
    322315    // The following are stubs.
    323316    bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented);
    324 #if ENABLE(NOTIFICATIONS)
    325317    bindMethod("denyWebNotificationPermission", &TestRunner::notImplemented);
    326318    bindMethod("removeAllWebNotificationPermissions", &TestRunner::notImplemented);
    327319    bindMethod("simulateWebNotificationClick", &TestRunner::notImplemented);
    328 #endif
    329320    bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented);
    330321    bindMethod("setScrollbarPolicy", &TestRunner::notImplemented);
     
    367358        m_webView->setZoomLevel(false, 0);
    368359        m_webView->setTabKeyCyclesThroughElements(true);
    369 #if !OS(DARWIN) && !OS(WINDOWS) // Actually, TOOLKIT_GTK
     360#if !defined(__APPLE__) && !defined(WIN32) // Actually, TOOLKIT_GTK
    370361        // (Constants copied because we can't depend on the header that defined
    371362        // them from this file.)
     
    382373
    383374    WebSecurityPolicy::resetOriginAccessWhitelists();
    384 #if OS(LINUX) || OS(ANDROID)
     375#if defined(__linux__) || defined(ANDROID)
    385376    WebFontRendering::setSubpixelPositioning(false);
    386377#endif
     
    421412    m_willSendRequestShouldReturnNull = false;
    422413    m_smartInsertDeleteEnabled = true;
    423 #if OS(WINDOWS)
     414#ifdef WIN32
    424415    m_selectTrailingWhitespaceEnabled = true;
    425416#else
     
    637628void TestRunner::policyDelegateDone()
    638629{
    639     ASSERT(m_waitUntilDone);
     630    WEBKIT_ASSERT(m_waitUntilDone);
    640631    m_delegate->testFinished();
    641632    m_waitUntilDone = false;
     
    13321323    bool wrapAround = false;
    13331324    if (arguments.size() >= 2) {
    1334         Vector<std::string> optionsArray = arguments[1].toStringVector();
     1325        vector<string> optionsArray = arguments[1].toStringVector();
    13351326        findOptions.matchCase = true;
    13361327
     
    14121403void TestRunner::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result)
    14131404{
    1414 #if OS(LINUX) || OS(ANDROID)
     1405#if defined(__linux__) || defined(ANDROID)
    14151406    // Since FontConfig doesn't provide a variable to control subpixel positioning, we'll fall back
    14161407    // to setting it globally for all fonts.
     
    16811672        prefs->shouldRespectImageOrientation = cppVariantToBool(value);
    16821673    else if (key == "WebKitWebAudioEnabled")
    1683         ASSERT(cppVariantToBool(value));
     1674        WEBKIT_ASSERT(cppVariantToBool(value));
    16841675    else {
    16851676        string message("Invalid name for preference: ");
     
    17261717}
    17271718
    1728 #if ENABLE(WEB_INTENTS)
     1719#if ENABLE_WEB_INTENTS
    17291720void TestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result)
    17301721{
     
    18341825    m_delegate->setDeviceScaleFactor(value);
    18351826
    1836     OwnArrayPtr<CppVariant> callbackArguments = adoptArrayPtr(new CppVariant[1]);
    1837     callbackArguments[0].set(arguments[1]);
    1838     result->setNull();
    1839     m_delegate->postTask(new InvokeCallbackTask(this, callbackArguments.release(), 1));
     1827    auto_ptr<CppVariant> callbackArguments(new CppVariant());
     1828    callbackArguments->set(arguments[1]);
     1829    result->setNull();
     1830    m_delegate->postTask(new InvokeCallbackTask(this, callbackArguments));
    18401831}
    18411832
     
    18781869}
    18791870
    1880 #if ENABLE(NOTIFICATIONS)
    18811871void TestRunner::grantWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
    18821872{
     
    18971887    result->set(m_delegate->simulateLegacyWebNotificationClick(arguments[0].toString()));
    18981888}
    1899 #endif
    1900 
    1901 #if ENABLE(INPUT_SPEECH)
     1889
    19021890void TestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
    19031891{
     
    19171905    m_delegate->setMockSpeechInputDumpRect(arguments[0].toBoolean());
    19181906}
    1919 #endif
    1920 
    1921 #if ENABLE(SCRIPTED_SPEECH)
     1907
    19221908void TestRunner::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result)
    19231909{
     
    19421928    result->set(m_delegate->wasMockSpeechRecognitionAborted());
    19431929}
    1944 #endif
    19451930
    19461931void TestRunner::display(const CppArgumentList& arguments, CppVariant* result)
     
    21222107}
    21232108
    2124 #if ENABLE(POINTER_LOCK)
    21252109void TestRunner::didAcquirePointerLock(const CppArgumentList&, CppVariant* result)
    21262110{
     
    21522136    result->setNull();
    21532137}
    2154 #endif
    2155 
    2156 }
     2138
     2139}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h

    r142109 r142165  
    3535
    3636#include "CppBoundClass.h"
     37#include "TestCommon.h"
    3738#include "WebArrayBufferView.h"
    3839#include "WebDeliveredIntentClient.h"
     
    4041#include "WebTestRunner.h"
    4142#include "WebTextDirection.h"
     43#include <deque>
     44#include <memory>
    4245#include <public/WebURL.h>
    4346#include <set>
    4447#include <string>
    45 #include <wtf/Deque.h>
    4648
    4749namespace WebKit {
     
    142144
    143145        void setFrozen(bool frozen) { m_frozen = frozen; }
    144         bool isEmpty() { return m_queue.isEmpty(); }
     146        bool isEmpty() { return m_queue.empty(); }
    145147        WebTaskList* taskList() { return &m_taskList; }
    146148
     
    154156
    155157        WebTaskList m_taskList;
    156         Deque<WorkItem*> m_queue;
     158        std::deque<WorkItem*> m_queue;
    157159        bool m_frozen;
    158160        TestRunner* m_controller;
     
    276278    void setMockDeviceOrientation(const CppArgumentList&, CppVariant*);
    277279
    278 #if ENABLE(POINTER_LOCK)
    279280    void didAcquirePointerLock(const CppArgumentList&, CppVariant*);
    280281    void didNotAcquirePointerLock(const CppArgumentList&, CppVariant*);
     
    282283    void setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant*);
    283284    void setPointerLockWillRespondAsynchronously(const CppArgumentList&, CppVariant*);
    284 #endif
    285285
    286286    ///////////////////////////////////////////////////////////////////////////
     
    421421    // Methods interacting with the WebTestProxy
    422422
    423 #if ENABLE(WEB_INTENTS)
     423#if ENABLE_WEB_INTENTS
    424424    // Expects one string argument for sending successful result, zero
    425425    // arguments for sending a failure result.
     
    469469    void setMockGeolocationPositionUnavailableError(const CppArgumentList&, CppVariant*);
    470470
    471 #if ENABLE(NOTIFICATIONS)
    472471    // Grants permission for desktop notifications to an origin
    473472    void grantWebNotificationPermission(const CppArgumentList&, CppVariant*);
    474473    // Simulates a click on a desktop notification.
    475474    void simulateLegacyWebNotificationClick(const CppArgumentList&, CppVariant*);
    476 #endif
    477475
    478476    // Speech input related functions.
    479 #if ENABLE(INPUT_SPEECH)
    480477    void addMockSpeechInputResult(const CppArgumentList&, CppVariant*);
    481478    void setMockSpeechInputDumpRect(const CppArgumentList&, CppVariant*);
    482 #endif
    483 #if ENABLE(SCRIPTED_SPEECH)
    484479    void addMockSpeechRecognitionResult(const CppArgumentList&, CppVariant*);
    485480    void setMockSpeechRecognitionError(const CppArgumentList&, CppVariant*);
    486481    void wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant*);
    487 #endif
    488482
    489483    void display(const CppArgumentList&, CppVariant*);
     
    683677
    684678    // Mock object for testing delivering web intents.
    685     OwnPtr<WebKit::WebDeliveredIntentClient> m_intentClient;
     679    std::auto_ptr<WebKit::WebDeliveredIntentClient> m_intentClient;
    686680
    687681    // WebPermissionClient mock object.
    688     OwnPtr<WebPermissions> m_webPermissions;
     682    std::auto_ptr<WebPermissions> m_webPermissions;
    689683};
    690684
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp

    r142109 r142165  
    3232#include "TextInputController.h"
    3333
     34#include "TestCommon.h"
    3435#include "WebBindings.h"
    3536#include "WebCompositionUnderline.h"
     
    4142#include <public/WebVector.h>
    4243#include <string>
    43 #include <wtf/StringExtras.h>
    4444
    4545using namespace WebKit;
     46using namespace std;
    4647
    4748namespace WebTestRunner {
     
    147148
    148149    WebRange range = mainFrame->markedRange();
    149     Vector<int> intArray(2);
     150    vector<int> intArray(2);
    150151    intArray[0] = range.startOffset();
    151152    intArray[1] = range.endOffset();
     
    162163
    163164    WebRange range = mainFrame->selectionRange();
    164     Vector<int> intArray(2);
     165    vector<int> intArray(2);
    165166    intArray[0] = range.startOffset();
    166167    intArray[1] = range.endOffset();
     
    183184        return;
    184185
    185     Vector<int> intArray(4);
     186    vector<int> intArray(4);
    186187    intArray[0] = rect.x;
    187188    intArray[1] = rect.y;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp

    r142109 r142165  
    4141void WebPreferences::reset()
    4242{
    43 #if OS(MAC_OS_X)
     43#ifdef __APPLE__
    4444    cursiveFontFamily = WebString::fromUTF8("Apple Chancery");
    4545    fantasyFontFamily = WebString::fromUTF8("Papyrus");
     
    107107    allowUniversalAccessFromFileURLs = true;
    108108
    109 #if OS(DARWIN)
     109#ifdef __APPLE__
    110110    editingBehavior = WebSettings::EditingBehaviorMac;
    111111#else
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTask.cpp

    r142109 r142165  
    3333
    3434#include "WebKit.h"
    35 #include <wtf/Vector.h>
     35#include <algorithm>
     36
     37using namespace std;
    3638
    3739namespace WebTestRunner {
     
    4951}
    5052
    51 class WebTaskList::Private : public Vector<WebTask*> {
    52 };
    53 
    5453WebTaskList::WebTaskList()
    55     : m_private(new Private)
    5654{
    5755}
     
    6058{
    6159    revokeAll();
    62     delete m_private;
    6360}
    6461
    6562void WebTaskList::registerTask(WebTask* task)
    6663{
    67     m_private->append(task);
     64    m_tasks.push_back(task);
    6865}
    6966
    7067void WebTaskList::unregisterTask(WebTask* task)
    7168{
    72     size_t index = m_private->find(task);
    73     if (index != notFound)
    74         m_private->remove(index);
     69    vector<WebTask*>::iterator iter = find(m_tasks.begin(), m_tasks.end(), task);
     70    if (iter != m_tasks.end())
     71        m_tasks.erase(iter);
    7572}
    7673
    7774void WebTaskList::revokeAll()
    7875{
    79     while (!m_private->isEmpty())
    80         (*m_private)[0]->cancel();
     76    while (!m_tasks.empty())
     77        m_tasks[0]->cancel();
    8178}
    8279
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp

    r142109 r142165  
    4040
    4141WebTestInterfaces::WebTestInterfaces()
     42    : m_interfaces(new TestInterfaces())
    4243{
    43     m_interfaces = new TestInterfaces;
    4444}
    4545
    4646WebTestInterfaces::~WebTestInterfaces()
    4747{
    48     delete m_interfaces;
    4948}
    5049
     
    8685TestInterfaces* WebTestInterfaces::testInterfaces()
    8786{
    88     return m_interfaces;
     87    return m_interfaces.get();
    8988}
    9089
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp

    r142109 r142165  
    3535#include "EventSender.h"
    3636#include "SpellCheckClient.h"
     37#include "TestCommon.h"
    3738#include "TestInterfaces.h"
    3839#include "TestPlugin.h"
     
    5960#include <public/WebURLRequest.h>
    6061#include <public/WebURLResponse.h>
    61 #include <wtf/StringExtras.h>
    6262
    6363using namespace WebKit;
     
    213213    size_t pos = url.rfind('/');
    214214    if (pos == string::npos) {
    215 #if OS(WINDOWS)
     215#ifdef WIN32
    216216        pos = url.rfind('\\');
    217217        if (pos == string::npos)
     
    268268WebTestProxyBase::~WebTestProxyBase()
    269269{
    270     delete m_spellcheck;
    271270}
    272271
     
    291290WebSpellCheckClient* WebTestProxyBase::spellCheckClient() const
    292291{
    293     return m_spellcheck;
     292    return m_spellcheck.get();
    294293}
    295294
     
    557556void WebTestProxyBase::registerIntentService(WebFrame*, const WebIntentServiceInfo& service)
    558557{
    559 #if ENABLE(WEB_INTENTS)
     558#if ENABLE_WEB_INTENTS
    560559    m_delegate->printMessage(string("Registered Web Intent Service: action=") + service.action().utf8().data() + " type=" + service.type().utf8().data() + " title=" + service.title().utf8().data() + " url=" + service.url().spec().data() + " disposition=" + service.disposition().utf8().data() + "\n");
    561560#endif
     
    564563void WebTestProxyBase::dispatchIntent(WebFrame* source, const WebIntentRequest& request)
    565564{
    566 #if ENABLE(WEB_INTENTS)
     565#if ENABLE_WEB_INTENTS
    567566    m_delegate->printMessage(string("Received Web Intent: action=") + request.intent().action().utf8().data() + " type=" + request.intent().type().utf8().data() + "\n");
    568567    WebMessagePortChannelArray* ports = request.intent().messagePortChannelsRelease();
     
    779778{
    780779    if (m_testInterfaces->testRunner()->shouldDumpResourceLoadCallbacks()) {
    781         ASSERT(m_resourceIdentifierMap.find(identifier) == m_resourceIdentifierMap.end());
     780        WEBKIT_ASSERT(m_resourceIdentifierMap.find(identifier) == m_resourceIdentifierMap.end());
    782781        m_resourceIdentifierMap[identifier] = descriptionSuitableForTestResult(request.url().spec());
    783782    }
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/config.h

    r142164 r142165  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    31 #ifndef WebTestInterfaces_h
    32 #define WebTestInterfaces_h
     31#ifndef config_h
     32#define config_h
    3333
    34 namespace WebKit {
    35 class WebFrame;
    36 class WebView;
    37 }
     34#define USE(feature) (defined WTF_USE_##feature && WTF_USE_##feature)
    3835
    39 namespace WebTestRunner {
    40 
    41 class TestInterfaces;
    42 class WebTestDelegate;
    43 class WebTestRunner;
    44 
    45 class WebTestInterfaces {
    46 public:
    47     WebTestInterfaces();
    48     ~WebTestInterfaces();
    49 
    50     void setWebView(WebKit::WebView*);
    51     void setDelegate(WebTestDelegate*);
    52     void bindTo(WebKit::WebFrame*);
    53     void resetAll();
    54     void setTestIsRunning(bool);
    55 
    56     WebKit::WebView* webView() const;
    57     WebTestRunner* testRunner();
    58 
    59 #if WEBTESTRUNNER_IMPLEMENTATION
    60     TestInterfaces* testInterfaces();
    61 #endif
    62 
    63 private:
    64     TestInterfaces* m_interfaces;
    65 };
    66 
    67 }
    68 
    69 #endif // WebTestInterfaces_h
     36#endif // config_h
Note: See TracChangeset for help on using the changeset viewer.