Changeset 142109 in webkit
- Timestamp:
- Feb 7, 2013 6:20:04 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r142090 r142109 1 2013-02-07 Gavin Peters <gavinp@chromium.org> 2 3 Unreviewed, rolling out r142090. 4 http://trac.webkit.org/changeset/142090 5 https://bugs.webkit.org/show_bug.cgi?id=108466 6 7 lots of selection expectations failures 8 9 * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: 10 * DumpRenderTree/DumpRenderTree.gypi: 11 * DumpRenderTree/chromium/TestRunner/public/WebPreferences.h: 12 * DumpRenderTree/chromium/TestRunner/public/WebTask.h: 13 (WebTaskList): 14 * DumpRenderTree/chromium/TestRunner/public/WebTestCommon.h: Removed. 15 * DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h: 16 (WebTestInterfaces): 17 * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h: 18 (WebTestProxyBase): 19 * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp: 20 (WebTestRunner::AccessibilityUIElement::AccessibilityUIElement): 21 (WebTestRunner::AccessibilityUIElementList::getOrCreate): 22 (WebTestRunner::AccessibilityUIElementList::createRoot): 23 * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h: 24 (AccessibilityUIElementList): 25 * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp: 26 (WebTestRunner::CppBoundClass::~CppBoundClass): 27 (WebTestRunner::CppBoundClass::invoke): 28 (WebTestRunner::CppBoundClass::getProperty): 29 (WebTestRunner::CppBoundClass::setProperty): 30 (WebTestRunner::CppBoundClass::bindCallback): 31 (WebTestRunner::CppBoundClass::bindGetterCallback): 32 (WebTestRunner::CppBoundClass::bindProperty): 33 (WebTestRunner::CppBoundClass::getAsCppVariant): 34 * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h: 35 (WebTestRunner): 36 (CppBoundClass): 37 (WebTestRunner::CppBoundClass::bindProperty): 38 (WebTestRunner::CppBoundClass::bindFallbackCallback): 39 (WebTestRunner::CppBoundClass::bindFallbackMethod): 40 * DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp: 41 (WebTestRunner::CppVariant::toString): 42 (WebTestRunner::CppVariant::toInt32): 43 (WebTestRunner::CppVariant::toDouble): 44 (WebTestRunner::CppVariant::toBoolean): 45 (WebTestRunner::CppVariant::toStringVector): 46 (WebTestRunner::CppVariant::invoke): 47 (WebTestRunner::CppVariant::invokeDefault): 48 * DumpRenderTree/chromium/TestRunner/src/CppVariant.h: 49 (CppVariant): 50 * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: 51 (WebTestRunner): 52 (WebTestRunner::EventSender::EventSender): 53 (WebTestRunner::EventSender::reset): 54 (WebTestRunner::EventSender::mouseDown): 55 (WebTestRunner::EventSender::mouseUp): 56 (WebTestRunner::EventSender::mouseMoveTo): 57 (WebTestRunner::EventSender::keyDown): 58 (WebTestRunner::EventSender::dispatchMessage): 59 (WebTestRunner::EventSender::leapForward): 60 (WebTestRunner::EventSender::replaySavedEvents): 61 (WebTestRunner::makeMenuItemStringsFor): 62 (WebTestRunner::EventSender::contextClick): 63 (WebTestRunner::EventSender::beginDragWithFiles): 64 (WebTestRunner::EventSender::addTouchPoint): 65 (WebTestRunner::EventSender::releaseTouchPoint): 66 (WebTestRunner::EventSender::updateTouchPoint): 67 (WebTestRunner::EventSender::cancelTouchPoint): 68 (WebTestRunner::EventSender::sendCurrentTouchEvent): 69 (WebTestRunner::EventSender::gestureEvent): 70 * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp: 71 (WebTestRunner::NativeKeyCodeForWindowsKeyCode): 72 * DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.cpp: 73 (MockGrammarCheck::checkGrammarOfString): 74 * DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.h: 75 (MockGrammarCheck): 76 * DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp: 77 (append): 78 (isNotASCIIAlpha): 79 (MockSpellCheck::spellCheckWord): 80 (MockSpellCheck::initializeIfNeeded): 81 * DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h: 82 (MockSpellCheck): 83 * DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp: 84 (WebTestRunner::SpellCheckClient::checkTextOfParagraph): 85 (WebTestRunner::SpellCheckClient::finishLastTextCheck): 86 * DumpRenderTree/chromium/TestRunner/src/TestCommon.h: Removed. 87 * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp: 88 (WebTestRunner::TestInterfaces::TestInterfaces): 89 * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h: 90 (TestInterfaces): 91 * DumpRenderTree/chromium/TestRunner/src/TestPlugin.cpp: 92 (WebTestRunner::TestPlugin::TestPlugin): 93 (WebTestRunner::TestPlugin::initialize): 94 (WebTestRunner::TestPlugin::destroy): 95 (WebTestRunner::TestPlugin::parsePrimitive): 96 (WebTestRunner::TestPlugin::parseColor): 97 (WebTestRunner::TestPlugin::initProgram): 98 (WebTestRunner::TestPlugin::initPrimitive): 99 (WebTestRunner::TestPlugin::drawPrimitive): 100 (WebTestRunner::TestPlugin::loadShader): 101 (WebTestRunner::TestPlugin::loadProgram): 102 (WebTestRunner::TestPlugin::handleDragStatusUpdate): 103 * DumpRenderTree/chromium/TestRunner/src/TestPlugin.h: 104 (TestPlugin): 105 * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: 106 (WebTestRunner::TestRunner::WorkQueue::processWorkSoon): 107 (WebTestRunner::TestRunner::WorkQueue::processWork): 108 (WebTestRunner::TestRunner::WorkQueue::reset): 109 (WebTestRunner::TestRunner::WorkQueue::addWork): 110 (WebTestRunner::TestRunner::TestRunner): 111 (WebTestRunner::TestRunner::reset): 112 (WebTestRunner::TestRunner::policyDelegateDone): 113 (WebTestRunner::TestRunner::findString): 114 (WebTestRunner::TestRunner::setTextSubpixelPositioning): 115 (WebTestRunner::TestRunner::overridePreference): 116 (WebTestRunner): 117 (WebTestRunner::TestRunner::setBackingScaleFactor): 118 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 119 (WebTestRunner::TestRunner::WorkQueue::isEmpty): 120 (TestRunner): 121 * DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp: 122 (WebTestRunner::TextInputController::markedRange): 123 (WebTestRunner::TextInputController::selectedRange): 124 (WebTestRunner::TextInputController::firstRectForCharacterRange): 125 * DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp: 126 (WebTestRunner::WebPreferences::reset): 127 * DumpRenderTree/chromium/TestRunner/src/WebTask.cpp: 128 (WebTestRunner): 129 (WebTestRunner::WebTaskList::WebTaskList): 130 (WebTestRunner::WebTaskList::~WebTaskList): 131 (WebTestRunner::WebTaskList::registerTask): 132 (WebTestRunner::WebTaskList::unregisterTask): 133 (WebTestRunner::WebTaskList::revokeAll): 134 * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: 135 (WebTestRunner::WebTestInterfaces::WebTestInterfaces): 136 (WebTestRunner::WebTestInterfaces::~WebTestInterfaces): 137 (WebTestRunner::WebTestInterfaces::testInterfaces): 138 * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp: 139 (WebTestRunner::WebTestProxyBase::~WebTestProxyBase): 140 (WebTestRunner::WebTestProxyBase::spellCheckClient): 141 (WebTestRunner::WebTestProxyBase::registerIntentService): 142 (WebTestRunner::WebTestProxyBase::dispatchIntent): 143 (WebTestRunner::WebTestProxyBase::assignIdentifierToRequest): 144 * DumpRenderTree/chromium/TestRunner/src/config.h: Removed. 145 1 146 2013-02-07 Jochen Eisinger <jochen@chromium.org> 2 147 -
trunk/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
r142090 r142109 84 84 'TestRunner_resources', 85 85 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit', 86 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit_wtf_support', 86 87 '<(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', 87 90 ], 88 91 'include_dirs': [ … … 104 107 ], 105 108 '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 }],140 109 ['toolkit_uses_gtk == 1', { 141 110 'defines': [ … … 227 196 '<(source_dir)/WebKit/chromium/WebKit.gyp:inspector_resources', 228 197 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit', 229 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit_wtf_support',230 198 '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf', 231 199 '<(chromium_src_dir)/base/base.gyp:test_support_base', -
trunk/Tools/DumpRenderTree/DumpRenderTree.gypi
r142090 r142109 58 58 'chromium/TestRunner/public/WebPreferences.h', 59 59 'chromium/TestRunner/public/WebTask.h', 60 'chromium/TestRunner/public/WebTestCommon.h',61 60 'chromium/TestRunner/public/WebTestInterfaces.h', 62 61 'chromium/TestRunner/public/WebTestProxy.h', … … 82 81 'chromium/TestRunner/src/SpellCheckClient.cpp', 83 82 'chromium/TestRunner/src/SpellCheckClient.h', 84 'chromium/TestRunner/src/TestCommon.h',85 83 'chromium/TestRunner/src/TestInterfaces.cpp', 86 84 'chromium/TestRunner/src/TestInterfaces.h', -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebPreferences.h
r142090 r142109 35 35 #include "Platform/chromium/public/WebURL.h" 36 36 #include "WebKit/chromium/public/WebSettings.h" 37 #include "WebTestCommon.h"38 37 39 38 namespace WebKit { … … 43 42 namespace WebTestRunner { 44 43 45 struct W EBTESTRUNNER_EXPORT WebPreferences {44 struct WebPreferences { 46 45 WebKit::WebString standardFontFamily; 47 46 WebKit::WebString fixedFontFamily; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTask.h
r142090 r142109 32 32 #define WebTask_h 33 33 34 #include "WebTestCommon.h"35 #include <vector>36 37 34 namespace WebTestRunner { 38 35 … … 41 38 // WebTask represents a task which can run by WebTestDelegate::postTask() or 42 39 // WebTestDelegate::postDelayedTask(). 43 class W EBTESTRUNNER_EXPORT WebTask {40 class WebTask { 44 41 public: 45 42 explicit WebTask(WebTaskList*); … … 55 52 }; 56 53 57 class W EBTESTRUNNER_EXPORT WebTaskList {54 class WebTaskList { 58 55 public: 59 56 WebTaskList(); … … 64 61 65 62 private: 66 std::vector<WebTask*> m_tasks; 63 class Private; 64 Private* m_private; 67 65 }; 68 66 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h
r142090 r142109 32 32 #define WebTestInterfaces_h 33 33 34 #include "WebTestCommon.h"35 #include <memory>36 37 34 namespace WebKit { 38 35 class WebFrame; … … 46 43 class WebTestRunner; 47 44 48 class W EBTESTRUNNER_EXPORT WebTestInterfaces {45 class WebTestInterfaces { 49 46 public: 50 47 WebTestInterfaces(); … … 65 62 66 63 private: 67 std::auto_ptr<TestInterfaces>m_interfaces;64 TestInterfaces* m_interfaces; 68 65 }; 69 66 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h
r142090 r142109 43 43 #include "WebKit/chromium/public/WebTextAffinity.h" 44 44 #include "WebKit/chromium/public/WebTextDirection.h" 45 #include "WebTestCommon.h"46 45 #include <map> 47 #include <memory>48 46 #include <string> 49 47 … … 82 80 class WebTestRunner; 83 81 84 class W EBTESTRUNNER_EXPORT WebTestProxyBase {82 class WebTestProxyBase { 85 83 public: 86 84 void setInterfaces(WebTestInterfaces*); … … 168 166 WebTestDelegate* m_delegate; 169 167 170 std::auto_ptr<SpellCheckClient>m_spellcheck;168 SpellCheckClient* m_spellcheck; 171 169 172 170 WebKit::WebRect m_paintRect; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp
r142090 r142109 32 32 #include "AccessibilityUIElementChromium.h" 33 33 34 #include "TestCommon.h"35 34 #include "WebAccessibilityObject.h" 36 35 #include <public/WebCString.h> … … 38 37 #include <public/WebRect.h> 39 38 #include <public/WebString.h> 39 #include <wtf/Assertions.h> 40 #include <wtf/StringExtras.h> 40 41 41 42 using namespace WebKit; … … 368 369 { 369 370 370 WEBKIT_ASSERT(factory);371 ASSERT(factory); 371 372 372 373 // … … 1025 1026 1026 1027 AccessibilityUIElement* element = new AccessibilityUIElement(object, this); 1027 m_elements. push_back(element);1028 m_elements.append(element); 1028 1029 return element; 1029 1030 } … … 1032 1033 { 1033 1034 AccessibilityUIElement* element = new RootAccessibilityUIElement(object, this); 1034 m_elements. push_back(element);1035 m_elements.append(element); 1035 1036 return element; 1036 1037 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h
r142090 r142109 35 35 #include "WebAccessibilityObject.h" 36 36 #include <vector> 37 #include <wtf/Vector.h> 37 38 38 39 namespace WebTestRunner { … … 168 169 169 170 private: 170 typedef std::vector<AccessibilityUIElement*> ElementList;171 typedef Vector<AccessibilityUIElement*> ElementList; 171 172 ElementList m_elements; 172 173 }; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp
r142090 r142109 43 43 #include "CppBoundClass.h" 44 44 45 #include "TestCommon.h"46 45 #include "WebBindings.h" 47 46 #include "WebFrame.h" 48 #include <memory>49 47 #include <public/WebString.h> 48 #include <wtf/Assertions.h> 49 #include <wtf/OwnPtr.h> 50 50 51 51 using namespace WebKit; … … 78 78 class GetterPropertyCallback : public CppBoundClass::PropertyCallback { 79 79 public: 80 GetterPropertyCallback( auto_ptr<CppBoundClass::GetterCallback> callback)80 GetterPropertyCallback(PassOwnPtr<CppBoundClass::GetterCallback> callback) 81 81 : m_callback(callback) 82 82 { … … 92 92 93 93 private: 94 auto_ptr<CppBoundClass::GetterCallback> m_callback;94 OwnPtr<CppBoundClass::GetterCallback> m_callback; 95 95 }; 96 96 … … 210 210 { 211 211 for (MethodList::iterator i = m_methods.begin(); i != m_methods.end(); ++i) 212 delete i-> second;212 delete i->value; 213 213 214 214 for (PropertyList::iterator i = m_properties.begin(); i != m_properties.end(); ++i) 215 delete i-> second;215 delete i->value; 216 216 217 217 // Unregister ourselves if we were bound to a frame. … … 244 244 callback = m_fallbackCallback.get(); 245 245 } else 246 callback = (*method). second;246 callback = (*method).value; 247 247 248 248 // Build a CppArgumentList argument vector from the NPVariants coming in. … … 267 267 268 268 CppVariant cppValue; 269 if (!callback-> second->getValue(&cppValue))269 if (!callback->value->getValue(&cppValue)) 270 270 return false; 271 271 cppValue.copyToNPVariant(result); … … 281 281 CppVariant cppValue; 282 282 cppValue.set(*value); 283 return (*callback). second->setValue(cppValue);283 return (*callback).value->setValue(cppValue); 284 284 } 285 285 … … 289 289 MethodList::iterator oldCallback = m_methods.find(ident); 290 290 if (oldCallback != m_methods.end()) { 291 delete oldCallback-> second;291 delete oldCallback->value; 292 292 if (!callback) { 293 m_methods. erase(oldCallback);293 m_methods.remove(oldCallback); 294 294 return; 295 295 } 296 296 } 297 297 298 m_methods [ident] = callback;299 } 300 301 void CppBoundClass::bindGetterCallback(const string& name, auto_ptr<GetterCallback> callback)302 { 303 PropertyCallback* propertyCallback = callback .get()? new GetterPropertyCallback(callback) : 0;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; 304 304 bindProperty(name, propertyCallback); 305 305 } … … 316 316 PropertyList::iterator oldCallback = m_properties.find(ident); 317 317 if (oldCallback != m_properties.end()) { 318 delete oldCallback-> second;318 delete oldCallback->value; 319 319 if (!callback) { 320 m_properties. erase(oldCallback);320 m_properties.remove(oldCallback); 321 321 return; 322 322 } 323 323 } 324 324 325 m_properties [ident] = callback;325 m_properties.set(ident, callback); 326 326 } 327 327 … … 345 345 WebBindings::releaseObject(npObj); // CppVariant takes the reference. 346 346 } 347 WEBKIT_ASSERT(m_selfVariant.isObject());347 ASSERT(m_selfVariant.isObject()); 348 348 return &m_selfVariant; 349 349 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h
r142090 r142109 45 45 46 46 #include "CppVariant.h" 47 #include <map> 48 #include <memory> 49 #include <vector> 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> 50 52 51 53 namespace WebKit { … … 56 58 namespace WebTestRunner { 57 59 58 typedef std::vector<CppVariant> CppArgumentList;60 typedef Vector<CppVariant> CppArgumentList; 59 61 60 62 // CppBoundClass lets you map Javascript method calls and property accesses 61 63 // directly to C++ method calls and CppVariant* variable access. 62 64 class CppBoundClass { 65 WTF_MAKE_NONCOPYABLE(CppBoundClass); 63 66 public: 64 67 class PropertyCallback { … … 162 165 // Bind Javascript property |name| to the C++ getter callback |callback|. 163 166 // This can be used to create read-only properties. 164 void bindGetterCallback(const std::string&, std::auto_ptr<GetterCallback>);167 void bindGetterCallback(const std::string&, PassOwnPtr<GetterCallback>); 165 168 166 169 // A wrapper for BindGetterCallback, to simplify the common case of binding a … … 170 173 void bindProperty(const std::string& name, void (T::*method)(CppVariant*)) 171 174 { 172 std::auto_ptr<GetterCallback> callback(new MemberGetterCallback<T>(static_cast<T*>(this), method));173 bindGetterCallback(name, callback );175 OwnPtr<GetterCallback> callback = adoptPtr(new MemberGetterCallback<T>(static_cast<T*>(this), method)); 176 bindGetterCallback(name, callback.release()); 174 177 } 175 178 … … 191 194 // fallback always returns true when checked for a method's 192 195 // existence). 193 void bindFallbackCallback( std::auto_ptr<Callback> fallbackCallback)196 void bindFallbackCallback(PassOwnPtr<Callback> fallbackCallback) 194 197 { 195 198 m_fallbackCallback = fallbackCallback; … … 203 206 void bindFallbackMethod(void (T::*method)(const CppArgumentList&, CppVariant*)) 204 207 { 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>()); 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); 209 213 } 210 214 … … 212 216 // but otherwise they should be considered private. 213 217 214 typedef std::map<NPIdentifier, PropertyCallback*> PropertyList;215 typedef std::map<NPIdentifier, Callback*> MethodList;218 typedef HashMap<NPIdentifier, PropertyCallback*> PropertyList; 219 typedef HashMap<NPIdentifier, Callback*> MethodList; 216 220 // These maps associate names with property and method pointers to be 217 221 // exposed to JavaScript. … … 220 224 221 225 // The callback gets invoked when a call is made to an nonexistent method. 222 std::auto_ptr<Callback> m_fallbackCallback;226 OwnPtr<Callback> m_fallbackCallback; 223 227 224 228 private: … … 239 243 // be unregistered with V8 when we delete it. 240 244 bool m_boundToFrame; 241 242 private:243 CppBoundClass(CppBoundClass&);244 CppBoundClass& operator=(const CppBoundClass&);245 245 }; 246 246 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp
r142090 r142109 32 32 #include "CppVariant.h" 33 33 34 #include "TestCommon.h"35 34 #include "WebBindings.h" 36 35 #include <limits> 36 #include <wtf/Assertions.h> 37 #include <wtf/StringExtras.h> 37 38 38 39 using namespace WebKit; … … 220 221 string CppVariant::toString() const 221 222 { 222 WEBKIT_ASSERT(isString());223 ASSERT(isString()); 223 224 return string(value.stringValue.UTF8Characters, 224 225 value.stringValue.UTF8Length); … … 231 232 if (isDouble()) 232 233 return static_cast<int32_t>(value.doubleValue); 233 WEBKIT_ASSERT_NOT_REACHED();234 ASSERT_NOT_REACHED(); 234 235 return 0; 235 236 } … … 241 242 if (isDouble()) 242 243 return value.doubleValue; 243 WEBKIT_ASSERT_NOT_REACHED();244 ASSERT_NOT_REACHED(); 244 245 return 0; 245 246 } … … 247 248 bool CppVariant::toBoolean() const 248 249 { 249 WEBKIT_ASSERT(isBool());250 ASSERT(isBool()); 250 251 return value.boolValue; 251 252 } 252 253 253 vector<string> CppVariant::toStringVector() const254 { 255 256 WEBKIT_ASSERT(isObject());257 vector<string> stringVector;254 Vector<string> CppVariant::toStringVector() const 255 { 256 257 ASSERT(isObject()); 258 Vector<string> stringVector; 258 259 NPObject* npValue = value.objectValue; 259 260 NPIdentifier lengthId = WebBindings::getStringIdentifier("length"); … … 290 291 string item(NPVARIANT_TO_STRING(indexValue).UTF8Characters, 291 292 NPVARIANT_TO_STRING(indexValue).UTF8Length); 292 stringVector. push_back(item);293 stringVector.append(item); 293 294 } 294 295 WebBindings::releaseVariantValue(&indexValue); … … 300 301 uint32_t argumentCount, CppVariant& result) const 301 302 { 302 WEBKIT_ASSERT(isObject());303 ASSERT(isObject()); 303 304 NPIdentifier methodName = WebBindings::getStringIdentifier(method.c_str()); 304 305 NPObject* npObject = value.objectValue; … … 314 315 CppVariant& result) const 315 316 { 316 WEBKIT_ASSERT(isObject());317 ASSERT(isObject()); 317 318 NPObject* npObject = value.objectValue; 318 319 NPVariant r; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h
r142090 r142109 45 45 #include "WebBindings.h" 46 46 #include <string> 47 #include < vector>47 #include <wtf/Vector.h> 48 48 49 49 namespace WebTestRunner { … … 121 121 // Returns a vector of strings for the specified argument. This is useful 122 122 // for converting a JavaScript array of strings into a vector of strings. 123 std::vector<std::string> toStringVector() const;123 Vector<std::string> toStringVector() const; 124 124 125 125 // Invoke method of the given name on an object with the supplied arguments. -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp
r142090 r142109 46 46 #include "KeyCodeMapping.h" 47 47 #include "MockSpellCheck.h" 48 #include "TestCommon.h"49 48 #include "WebContextMenuData.h" 50 49 #include "WebDragOperation.h" … … 52 51 #include "WebTouchPoint.h" 53 52 #include "WebView.h" 54 #include <deque>55 53 #include <public/WebDragData.h> 56 54 #include <public/WebPoint.h> 57 55 #include <public/WebString.h> 58 56 #include <public/WebVector.h> 59 60 #ifdef WIN32 57 #include <wtf/Deque.h> 58 #include <wtf/StringExtras.h> 59 60 #if OS(WINDOWS) 61 61 #include "win/WebInputEventFactory.h" 62 62 #endif … … 98 98 WebDragOperationsMask currentDragEffectsAllowed; 99 99 bool replayingSavedEvents = false; 100 deque<SavedEvent> mouseEventQueue;100 Deque<SavedEvent> mouseEventQueue; 101 101 int touchModifiers; 102 vector<WebTouchPoint> touchPoints;102 Vector<WebTouchPoint> touchPoints; 103 103 104 104 // Time and place of the last mouse up event. … … 156 156 const char* characters = modifierName.c_str(); 157 157 if (!strcmp(characters, "ctrlKey") 158 #if ndef __APPLE__158 #if !OS(MAC_OS_X) 159 159 || !strcmp(characters, "addSelectionKey") 160 160 #endif … … 165 165 else if (!strcmp(characters, "altKey")) { 166 166 event->modifiers |= WebInputEvent::AltKey; 167 #if ndef __APPLE__167 #if !OS(MAC_OS_X) 168 168 // On Windows all keys with Alt modifier will be marked as system key. 169 169 // We keep the same behavior on Linux and everywhere non-Mac, see: … … 173 173 isSystemKey = true; 174 174 #endif 175 #ifdef __APPLE__ 175 #if OS(MAC_OS_X) 176 } else if (!strcmp(characters, "metaKey") || !strcmp(characters, "addSelectionKey")) { 176 177 event->modifiers |= WebInputEvent::MetaKey; 177 178 // On Mac only command key presses are marked as system key. … … 191 192 bool isSystemKey = false; 192 193 if (argument->isObject()) { 193 vector<string> modifiers = argument->toStringVector();194 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) 195 196 isSystemKey |= applyKeyModifier(*i, event); 196 197 } else if (argument->isString()) … … 204 205 bool getEditCommand(const WebKeyboardEvent& event, string* name) 205 206 { 206 #if def __APPLE__207 #if OS(MAC_OS_X) 207 208 // We only cares about Left,Right,Up,Down keys with Command or Command+Shift 208 209 // modifiers. These key events correspond to some special movement and … … 307 308 // events so we can simulate drag & drop. 308 309 bindProperty("dragMode", &dragMode); 309 #if def WIN32310 #if OS(WINDOWS) 310 311 bindProperty("WM_KEYDOWN", &wmKeyDown); 311 312 bindProperty("WM_KEYUP", &wmKeyUp); … … 322 323 { 323 324 // The test should have finished a drag and the mouse button state. 324 WEBKIT_ASSERT(currentDragData.isNull());325 ASSERT(currentDragData.isNull()); 325 326 currentDragData.reset(); 326 327 currentDragEffect = WebKit::WebDragOperationNone; … … 328 329 pressedButton = WebMouseEvent::ButtonNone; 329 330 dragMode.set(true); 330 #if def WIN32331 #if OS(WINDOWS) 331 332 wmKeyDown.set(WM_KEYDOWN); 332 333 wmKeyUp.set(WM_KEYUP); … … 418 419 419 420 int buttonNumber = getButtonNumberFromSingleArg(arguments); 420 WEBKIT_ASSERT(buttonNumber != -1);421 ASSERT(buttonNumber != -1); 421 422 422 423 WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber); … … 440 441 441 442 int buttonNumber = getButtonNumberFromSingleArg(arguments); 442 WEBKIT_ASSERT(buttonNumber != -1);443 ASSERT(buttonNumber != -1); 443 444 444 445 WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber); … … 448 449 savedEvent.type = SavedEvent::MouseUp; 449 450 savedEvent.buttonType = buttonType; 450 mouseEventQueue. push_back(savedEvent);451 mouseEventQueue.append(savedEvent); 451 452 replaySavedEvents(); 452 453 } else { … … 505 506 savedEvent.type = SavedEvent::MouseMove; 506 507 savedEvent.pos = mousePos; 507 mouseEventQueue. push_back(savedEvent);508 mouseEventQueue.append(savedEvent); 508 509 } else { 509 510 WebMouseEvent event; … … 598 599 if (!code) { 599 600 WebString webCodeStr = WebString::fromUTF8(codeStr.data(), codeStr.size()); 600 WEBKIT_ASSERT(webCodeStr.length() == 1);601 ASSERT(webCodeStr.length() == 1); 601 602 text = code = webCodeStr.data()[0]; 602 603 needsShiftKeyModifier = needsShiftModifier(code); … … 616 617 eventDown.modifiers = 0; 617 618 eventDown.windowsKeyCode = code; 618 #if defined(__linux__) && USE(GTK)619 #if OS(LINUX) && USE(GTK) 619 620 eventDown.nativeKeyCode = NativeKeyCodeForWindowsKeyCode(code); 620 621 #endif … … 678 679 result->setNull(); 679 680 680 #if def WIN32681 #if OS(WINDOWS) 681 682 if (arguments.size() == 3) { 682 683 // Grab the message id to see if we need to dispatch it. … … 694 695 webview()->handleInputEvent(WebInputEventFactory::keyboardEvent(0, msg, arguments[1].toInt32(), lparam)); 695 696 } else 696 WEBKIT_ASSERT_NOT_REACHED();697 ASSERT_NOT_REACHED(); 697 698 #endif 698 699 } … … 718 719 savedEvent.type = SavedEvent::LeapForward; 719 720 savedEvent.milliseconds = milliseconds; 720 mouseEventQueue. push_back(savedEvent);721 mouseEventQueue.append(savedEvent); 721 722 } else 722 723 doLeapForward(milliseconds); … … 779 780 { 780 781 replayingSavedEvents = true; 781 while (!mouseEventQueue.empty()) { 782 SavedEvent e = mouseEventQueue.front(); 783 mouseEventQueue.pop_front(); 782 while (!mouseEventQueue.isEmpty()) { 783 SavedEvent e = mouseEventQueue.takeFirst(); 784 784 785 785 switch (e.type) { … … 800 800 } 801 801 default: 802 WEBKIT_ASSERT_NOT_REACHED();802 ASSERT_NOT_REACHED(); 803 803 } 804 804 } … … 814 814 // - Some test even checks actual string content. So providing it would be also helpful. 815 815 // 816 static vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, WebTestDelegate* delegate)816 static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, WebTestDelegate* delegate) 817 817 { 818 818 // These constants are based on Safari's context menu because tests are made for it. … … 822 822 // This is possible because mouse events are cancelleable. 823 823 if (!contextMenu) 824 return vector<WebString>();825 826 vector<WebString> strings;824 return Vector<WebString>(); 825 826 Vector<WebString> strings; 827 827 828 828 if (contextMenu->isEditable) { 829 829 for (const char** item = editableMenuStrings; *item; ++item) 830 strings. push_back(WebString::fromUTF8(*item));830 strings.append(WebString::fromUTF8(*item)); 831 831 WebVector<WebString> suggestions; 832 832 MockSpellCheck::fillSuggestionList(contextMenu->misspelledWord, &suggestions); 833 833 for (size_t i = 0; i < suggestions.size(); ++i) 834 strings. push_back(suggestions[i]);834 strings.append(suggestions[i]); 835 835 } else { 836 836 for (const char** item = nonEditableMenuStrings; *item; ++item) 837 strings. push_back(WebString::fromUTF8(*item));837 strings.append(WebString::fromUTF8(*item)); 838 838 } 839 839 … … 860 860 webview()->handleInputEvent(event); 861 861 862 #if def WIN32862 #if OS(WINDOWS) 863 863 initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); 864 864 webview()->handleInputEvent(event); … … 917 917 { 918 918 currentDragData.initialize(); 919 vector<string> files = arguments[0].toStringVector();919 Vector<string> files = arguments[0].toStringVector(); 920 920 WebVector<WebString> absoluteFilenames(files.size()); 921 921 for (size_t i = 0; i < files.size(); ++i) { … … 956 956 } 957 957 touchPoint.id = lowestId; 958 touchPoints. push_back(touchPoint);958 touchPoints.append(touchPoint); 959 959 } 960 960 … … 970 970 971 971 const unsigned index = arguments[0].toInt32(); 972 WEBKIT_ASSERT(index < touchPoints.size());972 ASSERT(index < touchPoints.size()); 973 973 974 974 WebTouchPoint* touchPoint = &touchPoints[index]; … … 1002 1002 1003 1003 const unsigned index = arguments[0].toInt32(); 1004 WEBKIT_ASSERT(index < touchPoints.size());1004 ASSERT(index < touchPoints.size()); 1005 1005 1006 1006 WebPoint position(arguments[1].toInt32(), arguments[2].toInt32()); … … 1016 1016 1017 1017 const unsigned index = arguments[0].toInt32(); 1018 WEBKIT_ASSERT(index < touchPoints.size());1018 ASSERT(index < touchPoints.size()); 1019 1019 1020 1020 WebTouchPoint* touchPoint = &touchPoints[index]; … … 1024 1024 void EventSender::sendCurrentTouchEvent(const WebInputEvent::Type type) 1025 1025 { 1026 WEBKIT_ASSERT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap) > touchPoints.size());1026 ASSERT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap) > touchPoints.size()); 1027 1027 webview()->layout(); 1028 1028 … … 1039 1039 WebTouchPoint* touchPoint = &touchPoints[i]; 1040 1040 if (touchPoint->state == WebTouchPoint::StateReleased) { 1041 touchPoints. erase(touchPoints.begin() +i);1041 touchPoints.remove(i); 1042 1042 --i; 1043 1043 } else … … 1266 1266 break; 1267 1267 default: 1268 WEBKIT_ASSERT_NOT_REACHED();1268 ASSERT_NOT_REACHED(); 1269 1269 } 1270 1270 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp
r142090 r142109 32 32 #include "KeyCodeMapping.h" 33 33 34 #include <wtf/UnusedParam.h> 35 34 36 namespace WebTestRunner { 35 37 36 38 int NativeKeyCodeForWindowsKeyCode(int keysym) 37 39 { 38 #if defined(__linux__) && USE(GTK)40 #if OS(LINUX) && USE(GTK) 39 41 // See /usr/share/X11/xkb/keycodes/* 40 42 static const int asciiToKeyCode[] = { … … 239 241 } 240 242 #else 241 return keysym - keysym; 243 UNUSED_PARAM(keysym); 244 return 0; 242 245 #endif 243 246 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.cpp
r142090 r142109 32 32 #include "MockGrammarCheck.h" 33 33 34 #include "Platform/chromium/public/WebCString.h"35 34 #include "Platform/chromium/public/WebString.h" 36 #include "TestCommon.h"37 35 #include "WebTextCheckingResult.h" 38 #include <algorithm> 36 37 #include <wtf/ASCIICType.h> 38 #include <wtf/Assertions.h> 39 #include <wtf/text/WTFString.h> 39 40 40 41 using namespace WebKit; 41 using namespace std;42 42 43 namespace WebTestRunner { 44 45 bool MockGrammarCheck::checkGrammarOfString(const WebString& text, vector<WebTextCheckingResult>* results) 43 bool MockGrammarCheck::checkGrammarOfString(const WebString& text, Vector<WebTextCheckingResult>* results) 46 44 { 47 WEBKIT_ASSERT(results);48 string16 stringText = text;49 if ( find_if(stringText.begin(), stringText.end(), isASCIIAlpha) == stringText.end())45 ASSERT(results); 46 WTF::String stringText(text.data(), text.length()); 47 if (stringText.find(isASCIIAlpha) == static_cast<size_t>(-1)) 50 48 return true; 51 49 … … 72 70 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(grammarErrors); ++i) { 73 71 int offset = 0; 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)); 72 while ((offset = stringText.find(grammarErrors[i].text, offset)) != -1) { 73 results->append(WebTextCheckingResult(WebTextCheckingTypeGrammar, offset + grammarErrors[i].location, grammarErrors[i].length)); 77 74 offset += grammarErrors[i].length; 78 75 } … … 80 77 return false; 81 78 } 82 83 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockGrammarCheck.h
r142090 r142109 32 32 #define MockGrammarCheck_h 33 33 34 #include <vector> 34 #include <wtf/Vector.h> 35 #include <wtf/text/WTFString.h> 35 36 36 37 namespace WebKit { … … 41 42 } 42 43 43 namespace WebTestRunner {44 45 44 // A mock implementation of a grammar-checker used for WebKit tests. This class 46 45 // only implements the minimal functionarities required by WebKit tests, i.e. … … 50 49 class MockGrammarCheck { 51 50 public: 52 static bool checkGrammarOfString(const WebKit::WebString&, std::vector<WebKit::WebTextCheckingResult>*);51 static bool checkGrammarOfString(const WebKit::WebString&, Vector<WebKit::WebTextCheckingResult>*); 53 52 }; 54 53 55 }56 57 54 #endif // MockSpellCheck_h -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp
r142090 r142109 32 32 #include "MockSpellCheck.h" 33 33 34 #include "TestCommon.h" 35 #include <public/WebCString.h> 34 #include <wtf/ASCIICType.h> 35 #include <wtf/Assertions.h> 36 #include <wtf/text/WTFString.h> 36 37 37 38 using namespace WebKit; 38 using namespace std;39 39 40 namespace WebTestRunner { 41 42 namespace { 43 44 void append(WebVector<WebString>* data, const WebString& item) 40 static void append(WebVector<WebString>* data, const WebString& item) 45 41 { 46 42 WebVector<WebString> result(data->size() + 1); … … 51 47 } 52 48 53 }54 55 49 MockSpellCheck::MockSpellCheck() 56 50 : m_initialized(false) { } … … 58 52 MockSpellCheck::~MockSpellCheck() { } 59 53 54 static bool isNotASCIIAlpha(UChar ch) { return !isASCIIAlpha(ch); } 55 60 56 bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset, int* misspelledLength) 61 57 { 62 WEBKIT_ASSERT(misspelledOffset);63 WEBKIT_ASSERT(misspelledLength);58 ASSERT(misspelledOffset); 59 ASSERT(misspelledLength); 64 60 65 61 // Initialize this spellchecker. … … 70 66 *misspelledLength = 0; 71 67 72 // Convert to a string16 because we store string16instances in68 // Convert to a String because we store String instances in 73 69 // m_misspelledWords and WebString has no find(). 74 string16 stringText = text;70 String stringText(text.data(), text.length()); 75 71 int skippedLength = 0; 76 72 77 while (!stringText. empty()) {73 while (!stringText.isEmpty()) { 78 74 // Extract the first possible English word from the given string. 79 75 // The given string may include non-ASCII characters or numbers. So, we … … 83 79 // If the given string doesn't include any ASCII characters, we can treat the 84 80 // string as valid one. 85 string16::iterator firstChar = find_if(stringText.begin(), stringText.end(),isASCIIAlpha);86 if ( firstChar == stringText.end())81 int wordOffset = stringText.find(isASCIIAlpha); 82 if (wordOffset == -1) 87 83 return true; 88 int wordOffset = distance(stringText.begin(), firstChar);89 84 int maxWordLength = static_cast<int>(stringText.length()) - wordOffset; 90 85 int wordLength; 91 string16word;86 String word; 92 87 93 88 // Look up our misspelled-word table to check if the extracted word is a … … 98 93 for (size_t i = 0; i < m_misspelledWords.size(); ++i) { 99 94 wordLength = static_cast<int>(m_misspelledWords.at(i).length()) > maxWordLength ? maxWordLength : static_cast<int>(m_misspelledWords.at(i).length()); 100 word = stringText.substr (wordOffset, wordLength);95 word = stringText.substring(wordOffset, wordLength); 101 96 if (word == m_misspelledWords.at(i) && (static_cast<int>(stringText.length()) == wordOffset + wordLength || isNotASCIIAlpha(stringText[wordOffset + wordLength]))) { 102 97 *misspelledOffset = wordOffset + skippedLength; … … 109 104 break; 110 105 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); 106 int wordEnd = stringText.find(isNotASCIIAlpha, wordOffset); 107 wordLength = wordEnd == -1 ? static_cast<int>(stringText.length()) - wordOffset : wordEnd - wordOffset; 116 108 117 WEBKIT_ASSERT(0 < wordOffset + wordLength);118 stringText = stringText.substr (wordOffset + wordLength);109 ASSERT(0 < wordOffset + wordLength); 110 stringText = stringText.substring(wordOffset + wordLength); 119 111 skippedLength += wordOffset + wordLength; 120 112 } … … 179 171 m_misspelledWords.clear(); 180 172 for (size_t i = 0; i < arraysize(misspelledWords); ++i) 181 m_misspelledWords. push_back(string16(misspelledWords[i], misspelledWords[i] + strlen(misspelledWords[i])));173 m_misspelledWords.append(String::fromUTF8(misspelledWords[i])); 182 174 183 175 // Mark as initialized to prevent this object from being initialized twice … … 189 181 return false; 190 182 } 191 192 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h
r142090 r142109 34 34 #include "Platform/chromium/public/WebString.h" 35 35 #include "Platform/chromium/public/WebVector.h" 36 #include <vector> 37 38 namespace WebTestRunner { 36 #include <wtf/Vector.h> 37 #include <wtf/text/WTFString.h> 39 38 40 39 // A mock implementation of a spell-checker used for WebKit tests. … … 72 71 73 72 // A table that consists of misspelled words. 74 std::vector<string16> m_misspelledWords;73 Vector<String> m_misspelledWords; 75 74 76 75 // A flag representing whether or not this object is initialized. … … 78 77 }; 79 78 80 }81 82 79 #endif // MockSpellCheck_h -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp
r142090 r142109 38 38 39 39 using namespace WebKit; 40 using namespace std;41 40 42 41 namespace WebTestRunner { … … 83 82 void SpellCheckClient::checkTextOfParagraph(const WebString& text, WebTextCheckingTypeMask mask, WebVector<WebTextCheckingResult>* webResults) 84 83 { 85 vector<WebTextCheckingResult> results;84 Vector<WebTextCheckingResult> results; 86 85 if (mask & WebTextCheckingTypeSpelling) { 87 86 size_t offset = 0; … … 98 97 result.location = offset + misspelledPosition; 99 98 result.length = misspelledLength; 100 results. push_back(result);99 results.append(result); 101 100 offset += misspelledPosition + misspelledLength; 102 101 } … … 122 121 void SpellCheckClient::finishLastTextCheck() 123 122 { 124 vector<WebTextCheckingResult> results;123 Vector<WebTextCheckingResult> results; 125 124 int offset = 0; 126 string16 text = m_lastRequestedTextCheckString;125 String text(m_lastRequestedTextCheckString.data(), m_lastRequestedTextCheckString.length()); 127 126 while (text.length()) { 128 127 int misspelledPosition = 0; 129 128 int misspelledLength = 0; 130 m_spellcheck.spellCheckWord(WebString(text ), &misspelledPosition, &misspelledLength);129 m_spellcheck.spellCheckWord(WebString(text.characters(), text.length()), &misspelledPosition, &misspelledLength); 131 130 if (!misspelledLength) 132 131 break; 133 132 WebVector<WebString> suggestions; 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);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); 137 136 offset += misspelledPosition + misspelledLength; 138 137 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp
r142090 r142109 46 46 47 47 TestInterfaces::TestInterfaces() 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) 48 : m_webView(0) 54 49 { 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()); 55 55 } 56 56 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h
r142090 r142109 32 32 #define TestInterfaces_h 33 33 34 #include < memory>34 #include <wtf/OwnPtr.h> 35 35 36 36 namespace WebKit { … … 66 66 67 67 private: 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;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; 73 73 WebKit::WebView* m_webView; 74 74 }; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestPlugin.cpp
r142090 r142109 27 27 #include "TestPlugin.h" 28 28 29 #include "TestCommon.h"30 29 #include "WebFrame.h" 31 30 #include "WebInputEvent.h" … … 37 36 #include <public/WebCompositorSupport.h> 38 37 #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> 39 42 40 43 using namespace WebKit; 41 using namespace std;42 44 43 45 namespace WebTestRunner { … … 98 100 } 99 101 100 WEBKIT_ASSERT_NOT_REACHED();102 ASSERT_NOT_REACHED(); 101 103 return 0; 102 104 } … … 133 135 WebPluginContainer::TouchEventRequestType parseTouchEventRequestType(const WebString& string) 134 136 { 135 if (string == WebString::fromUTF8("raw")) 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) 136 141 return WebPluginContainer::TouchEventRequestTypeRaw; 137 if (string == WebString::fromUTF8("synthetic"))142 if (string == kPrimitiveSynthetic) 138 143 return WebPluginContainer::TouchEventRequestTypeSynthesizedMouse; 139 144 return WebPluginContainer::TouchEventRequestTypeNone; … … 164 169 static const WebString kAttributePrintUserGestureStatus = WebString::fromUTF8("print-user-gesture-status"); 165 170 166 WEBKIT_ASSERT(params.attributeNames.size() == params.attributeValues.size());171 ASSERT(params.attributeNames.size() == params.attributeValues.size()); 167 172 size_t size = params.attributeNames.size(); 168 173 for (size_t i = 0; i < size; ++i) { … … 208 213 return false; 209 214 210 m_layer = a uto_ptr<WebExternalTextureLayer>(Platform::current()->compositorSupport()->createExternalTextureLayer(this));215 m_layer = adoptPtr(Platform::current()->compositorSupport()->createExternalTextureLayer(this)); 211 216 m_container = container; 212 217 m_container->setWebLayer(m_layer->layer()); … … 224 229 if (m_container) 225 230 m_container->setWebLayer(0); 226 m_layer. reset();231 m_layer.clear(); 227 232 destroyScene(); 228 233 … … 271 276 primitive = PrimitiveTriangle; 272 277 else 273 WEBKIT_ASSERT_NOT_REACHED();278 ASSERT_NOT_REACHED(); 274 279 return primitive; 275 280 } … … 290 295 color[2] = 255; 291 296 else 292 WEBKIT_ASSERT_NOT_REACHED();297 ASSERT_NOT_REACHED(); 293 298 } 294 299 … … 357 362 bool TestPlugin::initProgram() 358 363 { 359 const string vertexSource(364 const CString vertexSource( 360 365 "attribute vec4 position; \n" 361 366 "void main() { \n" … … 364 369 ); 365 370 366 const string fragmentSource(371 const CString fragmentSource( 367 372 "precision mediump float; \n" 368 373 "uniform vec4 color; \n" … … 383 388 bool TestPlugin::initPrimitive() 384 389 { 385 WEBKIT_ASSERT(m_scene.primitive == PrimitiveTriangle);390 ASSERT(m_scene.primitive == PrimitiveTriangle); 386 391 387 392 m_scene.vbo = m_context->createBuffer(); … … 401 406 void TestPlugin::drawPrimitive() 402 407 { 403 WEBKIT_ASSERT(m_scene.primitive == PrimitiveTriangle);404 WEBKIT_ASSERT(m_scene.vbo);405 WEBKIT_ASSERT(m_scene.program);408 ASSERT(m_scene.primitive == PrimitiveTriangle); 409 ASSERT(m_scene.vbo); 410 ASSERT(m_scene.program); 406 411 407 412 m_context->useProgram(m_scene.program); … … 419 424 } 420 425 421 unsigned TestPlugin::loadShader(unsigned type, const string& source)426 unsigned TestPlugin::loadShader(unsigned type, const CString& source) 422 427 { 423 428 unsigned shader = m_context->createShader(type); … … 436 441 } 437 442 438 unsigned TestPlugin::loadProgram(const string& vertexSource, const string& fragmentSource)443 unsigned TestPlugin::loadProgram(const CString& vertexSource, const CString& fragmentSource) 439 444 { 440 445 unsigned vertexShader = loadShader(GL_VERTEX_SHADER, vertexSource); … … 529 534 break; 530 535 case WebDragStatusUnknown: 531 WEBKIT_ASSERT_NOT_REACHED();536 ASSERT_NOT_REACHED(); 532 537 } 533 538 m_delegate->printMessage(std::string("Plugin received event: ") + dragStatusName + "\n"); -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestPlugin.h
r142090 r142109 29 29 #include "WebPlugin.h" 30 30 #include "WebPluginContainer.h" 31 #include <memory>32 31 #include <public/WebExternalTextureLayer.h> 33 32 #include <public/WebExternalTextureLayerClient.h> 34 #include < string>33 #include <wtf/OwnPtr.h> 35 34 36 35 namespace WebTestRunner { … … 126 125 bool initPrimitive(); 127 126 void drawPrimitive(); 128 unsigned loadShader(unsigned type, const std::string& source);129 unsigned loadProgram(const std::string& vertexSource, const std::string& fragmentSource);127 unsigned loadShader(unsigned type, const WTF::CString& source); 128 unsigned loadProgram(const WTF::CString& vertexSource, const WTF::CString& fragmentSource); 130 129 131 130 WebKit::WebFrame* m_frame; … … 138 137 unsigned m_framebuffer; 139 138 Scene m_scene; 140 std::auto_ptr<WebKit::WebExternalTextureLayer> m_layer;139 OwnPtr<WebKit::WebExternalTextureLayer> m_layer; 141 140 142 141 WebKit::WebPluginContainer::TouchEventRequestType m_touchEventRequest; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
r142090 r142109 56 56 #include "WebWorkerInfo.h" 57 57 #include "v8/include/v8.h" 58 #include <limits>59 #include <memory>60 58 #include <public/WebData.h> 61 59 #include <public/WebPoint.h> 62 63 #if defined(__linux__) || defined(ANDROID) 60 #include <wtf/OwnArrayPtr.h> 61 #include <wtf/text/WTFString.h> 62 63 #if OS(LINUX) || OS(ANDROID) 64 64 #include "linux/WebFontRendering.h" 65 65 #endif … … 84 84 class InvokeCallbackTask : public WebMethodTask<TestRunner> { 85 85 public: 86 InvokeCallbackTask(TestRunner* object, auto_ptr<CppVariant> callbackArguments)86 InvokeCallbackTask(TestRunner* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) 87 87 : WebMethodTask<TestRunner>(object) 88 88 , m_callbackArguments(callbackArguments) 89 , m_numberOfArguments(numberOfArguments) 89 90 { 90 91 } … … 93 94 { 94 95 CppVariant invokeResult; 95 m_callbackArguments ->invokeDefault(m_callbackArguments.get(), 1, invokeResult);96 m_callbackArguments[0].invokeDefault(m_callbackArguments.get(), m_numberOfArguments, invokeResult); 96 97 } 97 98 98 99 private: 99 auto_ptr<CppVariant> m_callbackArguments; 100 OwnArrayPtr<CppVariant> m_callbackArguments; 101 uint32_t m_numberOfArguments; 100 102 }; 101 103 … … 112 114 return; 113 115 114 if (!m_queue. empty()) {116 if (!m_queue.isEmpty()) { 115 117 // We delay processing queued work to avoid recursion problems. 116 118 m_controller->m_delegate->postTask(new WorkQueueTask(this)); … … 122 124 { 123 125 // Quit doing work once a load is in progress. 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(); 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(); 128 129 if (startedLoad) 129 130 return; … … 137 138 { 138 139 m_frozen = false; 139 while (!m_queue.empty()) { 140 delete m_queue.front(); 141 m_queue.pop_front(); 142 } 140 while (!m_queue.isEmpty()) 141 delete m_queue.takeFirst(); 143 142 } 144 143 … … 149 148 return; 150 149 } 151 m_queue. push_back(work);150 m_queue.append(work); 152 151 } 153 152 … … 158 157 , m_delegate(0) 159 158 , m_webView(0) 160 , m_intentClient( new EmptyWebDeliveredIntentClient)161 , m_webPermissions( new WebPermissions)159 , m_intentClient(adoptPtr(new EmptyWebDeliveredIntentClient)) 160 , m_webPermissions(adoptPtr(new WebPermissions)) 162 161 { 163 162 // Initialize the map that associates methods of this class with the names … … 217 216 bindMethod("setSelectTrailingWhitespaceEnabled", &TestRunner::setSelectTrailingWhitespaceEnabled); 218 217 bindMethod("setMockDeviceOrientation", &TestRunner::setMockDeviceOrientation); 218 #if ENABLE(POINTER_LOCK) 219 219 bindMethod("didAcquirePointerLock", &TestRunner::didAcquirePointerLock); 220 220 bindMethod("didLosePointerLock", &TestRunner::didLosePointerLock); … … 222 222 bindMethod("setPointerLockWillRespondAsynchronously", &TestRunner::setPointerLockWillRespondAsynchronously); 223 223 bindMethod("setPointerLockWillFailSynchronously", &TestRunner::setPointerLockWillFailSynchronously); 224 #endif 224 225 225 226 // The following modify WebPreferences. … … 273 274 bindMethod("setWillSendRequestReturnsNullOnRedirect", &TestRunner::setWillSendRequestReturnsNullOnRedirect); 274 275 276 #if ENABLE(WEB_INTENTS) 275 277 // The following methods interact with the WebTestProxy. 276 #if ENABLE_WEB_INTENTS277 278 bindMethod("sendWebIntentResponse", &TestRunner::sendWebIntentResponse); 278 279 bindMethod("deliverWebIntent", &TestRunner::deliverWebIntent); … … 294 295 bindMethod("setMockGeolocationPositionUnavailableError", &TestRunner::setMockGeolocationPositionUnavailableError); 295 296 bindMethod("setMockGeolocationPosition", &TestRunner::setMockGeolocationPosition); 297 #if ENABLE(NOTIFICATIONS) 296 298 bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificationPermission); 297 299 bindMethod("simulateLegacyWebNotificationClick", &TestRunner::simulateLegacyWebNotificationClick); 300 #endif 301 #if ENABLE(INPUT_SPEECH) 298 302 bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult); 299 303 bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDumpRect); 304 #endif 305 #if ENABLE(SCRIPTED_SPEECH) 300 306 bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecognitionResult); 301 307 bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecognitionError); 302 308 bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechRecognitionAborted); 309 #endif 303 310 bindMethod("display", &TestRunner::display); 304 311 bindMethod("displayInvalidatedRegion", &TestRunner::displayInvalidatedRegion); … … 315 322 // The following are stubs. 316 323 bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented); 324 #if ENABLE(NOTIFICATIONS) 317 325 bindMethod("denyWebNotificationPermission", &TestRunner::notImplemented); 318 326 bindMethod("removeAllWebNotificationPermissions", &TestRunner::notImplemented); 319 327 bindMethod("simulateWebNotificationClick", &TestRunner::notImplemented); 328 #endif 320 329 bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented); 321 330 bindMethod("setScrollbarPolicy", &TestRunner::notImplemented); … … 358 367 m_webView->setZoomLevel(false, 0); 359 368 m_webView->setTabKeyCyclesThroughElements(true); 360 #if ! defined(__APPLE__) && !defined(WIN32) // Actually, TOOLKIT_GTK369 #if !OS(DARWIN) && !OS(WINDOWS) // Actually, TOOLKIT_GTK 361 370 // (Constants copied because we can't depend on the header that defined 362 371 // them from this file.) … … 373 382 374 383 WebSecurityPolicy::resetOriginAccessWhitelists(); 375 #if defined(__linux__) || defined(ANDROID)384 #if OS(LINUX) || OS(ANDROID) 376 385 WebFontRendering::setSubpixelPositioning(false); 377 386 #endif … … 412 421 m_willSendRequestShouldReturnNull = false; 413 422 m_smartInsertDeleteEnabled = true; 414 #if def WIN32423 #if OS(WINDOWS) 415 424 m_selectTrailingWhitespaceEnabled = true; 416 425 #else … … 628 637 void TestRunner::policyDelegateDone() 629 638 { 630 WEBKIT_ASSERT(m_waitUntilDone);639 ASSERT(m_waitUntilDone); 631 640 m_delegate->testFinished(); 632 641 m_waitUntilDone = false; … … 1323 1332 bool wrapAround = false; 1324 1333 if (arguments.size() >= 2) { 1325 vector<string> optionsArray = arguments[1].toStringVector();1334 Vector<std::string> optionsArray = arguments[1].toStringVector(); 1326 1335 findOptions.matchCase = true; 1327 1336 … … 1403 1412 void TestRunner::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result) 1404 1413 { 1405 #if defined(__linux__) || defined(ANDROID)1414 #if OS(LINUX) || OS(ANDROID) 1406 1415 // Since FontConfig doesn't provide a variable to control subpixel positioning, we'll fall back 1407 1416 // to setting it globally for all fonts. … … 1672 1681 prefs->shouldRespectImageOrientation = cppVariantToBool(value); 1673 1682 else if (key == "WebKitWebAudioEnabled") 1674 WEBKIT_ASSERT(cppVariantToBool(value));1683 ASSERT(cppVariantToBool(value)); 1675 1684 else { 1676 1685 string message("Invalid name for preference: "); … … 1717 1726 } 1718 1727 1719 #if ENABLE _WEB_INTENTS1728 #if ENABLE(WEB_INTENTS) 1720 1729 void TestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result) 1721 1730 { … … 1825 1834 m_delegate->setDeviceScaleFactor(value); 1826 1835 1827 auto_ptr<CppVariant> callbackArguments(new CppVariant());1828 callbackArguments ->set(arguments[1]);1829 result->setNull(); 1830 m_delegate->postTask(new InvokeCallbackTask(this, callbackArguments ));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)); 1831 1840 } 1832 1841 … … 1869 1878 } 1870 1879 1880 #if ENABLE(NOTIFICATIONS) 1871 1881 void TestRunner::grantWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result) 1872 1882 { … … 1887 1897 result->set(m_delegate->simulateLegacyWebNotificationClick(arguments[0].toString())); 1888 1898 } 1889 1899 #endif 1900 1901 #if ENABLE(INPUT_SPEECH) 1890 1902 void TestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) 1891 1903 { … … 1905 1917 m_delegate->setMockSpeechInputDumpRect(arguments[0].toBoolean()); 1906 1918 } 1907 1919 #endif 1920 1921 #if ENABLE(SCRIPTED_SPEECH) 1908 1922 void TestRunner::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result) 1909 1923 { … … 1928 1942 result->set(m_delegate->wasMockSpeechRecognitionAborted()); 1929 1943 } 1944 #endif 1930 1945 1931 1946 void TestRunner::display(const CppArgumentList& arguments, CppVariant* result) … … 2107 2122 } 2108 2123 2124 #if ENABLE(POINTER_LOCK) 2109 2125 void TestRunner::didAcquirePointerLock(const CppArgumentList&, CppVariant* result) 2110 2126 { … … 2136 2152 result->setNull(); 2137 2153 } 2138 2139 } 2154 #endif 2155 2156 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r142090 r142109 35 35 36 36 #include "CppBoundClass.h" 37 #include "TestCommon.h"38 37 #include "WebArrayBufferView.h" 39 38 #include "WebDeliveredIntentClient.h" … … 41 40 #include "WebTestRunner.h" 42 41 #include "WebTextDirection.h" 43 #include <deque>44 #include <memory>45 42 #include <public/WebURL.h> 46 43 #include <set> 47 44 #include <string> 45 #include <wtf/Deque.h> 48 46 49 47 namespace WebKit { … … 144 142 145 143 void setFrozen(bool frozen) { m_frozen = frozen; } 146 bool isEmpty() { return m_queue. empty(); }144 bool isEmpty() { return m_queue.isEmpty(); } 147 145 WebTaskList* taskList() { return &m_taskList; } 148 146 … … 156 154 157 155 WebTaskList m_taskList; 158 std::deque<WorkItem*> m_queue;156 Deque<WorkItem*> m_queue; 159 157 bool m_frozen; 160 158 TestRunner* m_controller; … … 278 276 void setMockDeviceOrientation(const CppArgumentList&, CppVariant*); 279 277 278 #if ENABLE(POINTER_LOCK) 280 279 void didAcquirePointerLock(const CppArgumentList&, CppVariant*); 281 280 void didNotAcquirePointerLock(const CppArgumentList&, CppVariant*); … … 283 282 void setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant*); 284 283 void setPointerLockWillRespondAsynchronously(const CppArgumentList&, CppVariant*); 284 #endif 285 285 286 286 /////////////////////////////////////////////////////////////////////////// … … 421 421 // Methods interacting with the WebTestProxy 422 422 423 #if ENABLE _WEB_INTENTS423 #if ENABLE(WEB_INTENTS) 424 424 // Expects one string argument for sending successful result, zero 425 425 // arguments for sending a failure result. … … 469 469 void setMockGeolocationPositionUnavailableError(const CppArgumentList&, CppVariant*); 470 470 471 #if ENABLE(NOTIFICATIONS) 471 472 // Grants permission for desktop notifications to an origin 472 473 void grantWebNotificationPermission(const CppArgumentList&, CppVariant*); 473 474 // Simulates a click on a desktop notification. 474 475 void simulateLegacyWebNotificationClick(const CppArgumentList&, CppVariant*); 476 #endif 475 477 476 478 // Speech input related functions. 479 #if ENABLE(INPUT_SPEECH) 477 480 void addMockSpeechInputResult(const CppArgumentList&, CppVariant*); 478 481 void setMockSpeechInputDumpRect(const CppArgumentList&, CppVariant*); 482 #endif 483 #if ENABLE(SCRIPTED_SPEECH) 479 484 void addMockSpeechRecognitionResult(const CppArgumentList&, CppVariant*); 480 485 void setMockSpeechRecognitionError(const CppArgumentList&, CppVariant*); 481 486 void wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant*); 487 #endif 482 488 483 489 void display(const CppArgumentList&, CppVariant*); … … 677 683 678 684 // Mock object for testing delivering web intents. 679 std::auto_ptr<WebKit::WebDeliveredIntentClient> m_intentClient;685 OwnPtr<WebKit::WebDeliveredIntentClient> m_intentClient; 680 686 681 687 // WebPermissionClient mock object. 682 std::auto_ptr<WebPermissions> m_webPermissions;688 OwnPtr<WebPermissions> m_webPermissions; 683 689 }; 684 690 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp
r142090 r142109 32 32 #include "TextInputController.h" 33 33 34 #include "TestCommon.h"35 34 #include "WebBindings.h" 36 35 #include "WebCompositionUnderline.h" … … 42 41 #include <public/WebVector.h> 43 42 #include <string> 43 #include <wtf/StringExtras.h> 44 44 45 45 using namespace WebKit; 46 using namespace std;47 46 48 47 namespace WebTestRunner { … … 148 147 149 148 WebRange range = mainFrame->markedRange(); 150 vector<int> intArray(2);149 Vector<int> intArray(2); 151 150 intArray[0] = range.startOffset(); 152 151 intArray[1] = range.endOffset(); … … 163 162 164 163 WebRange range = mainFrame->selectionRange(); 165 vector<int> intArray(2);164 Vector<int> intArray(2); 166 165 intArray[0] = range.startOffset(); 167 166 intArray[1] = range.endOffset(); … … 184 183 return; 185 184 186 vector<int> intArray(4);185 Vector<int> intArray(4); 187 186 intArray[0] = rect.x; 188 187 intArray[1] = rect.y; -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp
r142090 r142109 41 41 void WebPreferences::reset() 42 42 { 43 #if def __APPLE__43 #if OS(MAC_OS_X) 44 44 cursiveFontFamily = WebString::fromUTF8("Apple Chancery"); 45 45 fantasyFontFamily = WebString::fromUTF8("Papyrus"); … … 107 107 allowUniversalAccessFromFileURLs = true; 108 108 109 #if def __APPLE__109 #if OS(DARWIN) 110 110 editingBehavior = WebSettings::EditingBehaviorMac; 111 111 #else -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTask.cpp
r142090 r142109 33 33 34 34 #include "WebKit.h" 35 #include <algorithm> 36 37 using namespace std; 35 #include <wtf/Vector.h> 38 36 39 37 namespace WebTestRunner { … … 51 49 } 52 50 51 class WebTaskList::Private : public Vector<WebTask*> { 52 }; 53 53 54 WebTaskList::WebTaskList() 55 : m_private(new Private) 54 56 { 55 57 } … … 58 60 { 59 61 revokeAll(); 62 delete m_private; 60 63 } 61 64 62 65 void WebTaskList::registerTask(WebTask* task) 63 66 { 64 m_ tasks.push_back(task);67 m_private->append(task); 65 68 } 66 69 67 70 void WebTaskList::unregisterTask(WebTask* task) 68 71 { 69 vector<WebTask*>::iterator iter = find(m_tasks.begin(), m_tasks.end(),task);70 if (i ter != m_tasks.end())71 m_ tasks.erase(iter);72 size_t index = m_private->find(task); 73 if (index != notFound) 74 m_private->remove(index); 72 75 } 73 76 74 77 void WebTaskList::revokeAll() 75 78 { 76 while (!m_ tasks.empty())77 m_tasks[0]->cancel();79 while (!m_private->isEmpty()) 80 (*m_private)[0]->cancel(); 78 81 } 79 82 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp
r142090 r142109 40 40 41 41 WebTestInterfaces::WebTestInterfaces() 42 : m_interfaces(new TestInterfaces())43 42 { 43 m_interfaces = new TestInterfaces; 44 44 } 45 45 46 46 WebTestInterfaces::~WebTestInterfaces() 47 47 { 48 delete m_interfaces; 48 49 } 49 50 … … 85 86 TestInterfaces* WebTestInterfaces::testInterfaces() 86 87 { 87 return m_interfaces .get();88 return m_interfaces; 88 89 } 89 90 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
r142090 r142109 35 35 #include "EventSender.h" 36 36 #include "SpellCheckClient.h" 37 #include "TestCommon.h"38 37 #include "TestInterfaces.h" 39 38 #include "TestPlugin.h" … … 60 59 #include <public/WebURLRequest.h> 61 60 #include <public/WebURLResponse.h> 61 #include <wtf/StringExtras.h> 62 62 63 63 using namespace WebKit; … … 213 213 size_t pos = url.rfind('/'); 214 214 if (pos == string::npos) { 215 #if def WIN32215 #if OS(WINDOWS) 216 216 pos = url.rfind('\\'); 217 217 if (pos == string::npos) … … 268 268 WebTestProxyBase::~WebTestProxyBase() 269 269 { 270 delete m_spellcheck; 270 271 } 271 272 … … 290 291 WebSpellCheckClient* WebTestProxyBase::spellCheckClient() const 291 292 { 292 return m_spellcheck .get();293 return m_spellcheck; 293 294 } 294 295 … … 556 557 void WebTestProxyBase::registerIntentService(WebFrame*, const WebIntentServiceInfo& service) 557 558 { 558 #if ENABLE _WEB_INTENTS559 #if ENABLE(WEB_INTENTS) 559 560 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"); 560 561 #endif … … 563 564 void WebTestProxyBase::dispatchIntent(WebFrame* source, const WebIntentRequest& request) 564 565 { 565 #if ENABLE _WEB_INTENTS566 #if ENABLE(WEB_INTENTS) 566 567 m_delegate->printMessage(string("Received Web Intent: action=") + request.intent().action().utf8().data() + " type=" + request.intent().type().utf8().data() + "\n"); 567 568 WebMessagePortChannelArray* ports = request.intent().messagePortChannelsRelease(); … … 778 779 { 779 780 if (m_testInterfaces->testRunner()->shouldDumpResourceLoadCallbacks()) { 780 WEBKIT_ASSERT(m_resourceIdentifierMap.find(identifier) == m_resourceIdentifierMap.end());781 ASSERT(m_resourceIdentifierMap.find(identifier) == m_resourceIdentifierMap.end()); 781 782 m_resourceIdentifierMap[identifier] = descriptionSuitableForTestResult(request.url().spec()); 782 783 }
Note: See TracChangeset
for help on using the changeset viewer.