Changeset 57188 in webkit
- Timestamp:
- Apr 6, 2010 7:39:43 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r57187 r57188 1 2010-04-06 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 [DRT/Chromium] Add DumpRenderTree.gyp, and some small fixes 6 https://bugs.webkit.org/show_bug.cgi?id=37137 7 8 - Add DumpRenderTree.gyp 9 - Remove some dependencies to base/string_util.h, 10 base/compiler_specific.h, base/file_path.h, base/file_util.h, 11 base/message_loop.h, base/sys_string_conversions.h, 12 13 * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Added. 14 * DumpRenderTree/chromium/CppVariant.cpp: 15 (CppVariant::toStringVector): 16 * DumpRenderTree/chromium/EventSender.cpp: 17 (EventSender::EventSender): 18 (EventSender::keyDown): 19 (EventSender::scheduleAsynchronousClick): 20 (EventSender::beginDragWithFiles): 21 * DumpRenderTree/chromium/LayoutTestController.cpp: 22 (LayoutTestController::setUserStyleSheetLocation): 23 (LayoutTestController::pathToLocalResource): 24 * DumpRenderTree/chromium/TextInputController.cpp: 25 (TextInputController::markedRange): 26 (TextInputController::selectedRange): 27 1 28 2010-04-06 Dirk Pranke <dpranke@chromium.org> 2 29 -
trunk/WebKitTools/DumpRenderTree/chromium/CppVariant.cpp
r55563 r57188 32 32 #include "CppVariant.h" 33 33 34 #include "base/string_util.h"35 34 #include "public/WebBindings.h" 36 35 #include <limits> 37 36 #include <wtf/Assertions.h> 37 #include <wtf/StringExtras.h> 38 38 39 39 using namespace WebKit; … … 277 277 for (int i = 0; i < length; ++i) { 278 278 // Get each of the items. 279 string index = StringPrintf("%d", i); 279 char indexInChar[20]; // Enough size to store 32-bit integer 280 snprintf(indexInChar, 20, "%d", i); 281 string index(indexInChar); 280 282 NPIdentifier indexId = WebBindings::getStringIdentifier(index.c_str()); 281 283 if (!WebBindings::hasProperty(0, npValue, indexId)) -
trunk/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
r55713 r57188 45 45 46 46 #include "TestShell.h" 47 #include "base/compiler_specific.h"48 #include "base/file_path.h"49 #include "base/file_util.h"50 47 #include "base/keyboard_codes.h" 51 #include "base/message_loop.h"52 #include "base/string_util.h"53 #include "base/sys_string_conversions.h"54 48 #include "base/time.h" 55 49 #include "public/WebDragData.h" … … 58 52 #include "public/WebString.h" 59 53 #include "public/WebView.h" 54 #include "webkit/support/webkit_support.h" 60 55 #include <wtf/Deque.h> 56 #include <wtf/StringExtras.h> 61 57 62 58 #if OS(WINDOWS) … … 250 246 251 247 EventSender::EventSender(TestShell* shell) 252 : ALLOW_THIS_IN_INITIALIZER_LIST(m_methodFactory(this))248 : m_methodFactory(this) 253 249 { 254 250 // Set static testShell variable since we can't do it in an initializer list. … … 521 517 // event. This seems to work in the cases I tested. 522 518 // FIXME: Should we also generate a KEY_UP? 523 wstring codeStr = UTF8ToWide(arguments[0].toString());519 string codeStr = arguments[0].toString(); 524 520 525 521 // Convert \n -> VK_RETURN. Some layout tests use \n to mean "Enter", when … … 528 524 int text = 0; 529 525 bool needsShiftKeyModifier = false; 530 if ( L"\n" == codeStr) {526 if ("\n" == codeStr) { 531 527 generateChar = true; 532 528 text = code = base::VKEY_RETURN; 533 } else if ( L"rightArrow" == codeStr)529 } else if ("rightArrow" == codeStr) 534 530 code = base::VKEY_RIGHT; 535 else if ( L"downArrow" == codeStr)531 else if ("downArrow" == codeStr) 536 532 code = base::VKEY_DOWN; 537 else if ( L"leftArrow" == codeStr)533 else if ("leftArrow" == codeStr) 538 534 code = base::VKEY_LEFT; 539 else if ( L"upArrow" == codeStr)535 else if ("upArrow" == codeStr) 540 536 code = base::VKEY_UP; 541 else if ( L"delete" == codeStr)537 else if ("delete" == codeStr) 542 538 code = base::VKEY_BACK; 543 else if ( L"pageUp" == codeStr)539 else if ("pageUp" == codeStr) 544 540 code = base::VKEY_PRIOR; 545 else if ( L"pageDown" == codeStr)541 else if ("pageDown" == codeStr) 546 542 code = base::VKEY_NEXT; 547 else if ( L"home" == codeStr)543 else if ("home" == codeStr) 548 544 code = base::VKEY_HOME; 549 else if ( L"end" == codeStr)545 else if ("end" == codeStr) 550 546 code = base::VKEY_END; 551 547 else { … … 554 550 // name, set its key code. 555 551 for (int i = 1; i <= 24; ++i) { 556 wstring functionKeyName;557 functionKeyName += L"F";558 functionKeyName += IntToWString(i);552 char functionChars[10]; 553 snprintf(functionChars, 10, "F%d", i); 554 string functionKeyName(functionChars); 559 555 if (functionKeyName == codeStr) { 560 556 code = base::VKEY_F1 + (i - 1); … … 563 559 } 564 560 if (!code) { 565 ASSERT(codeStr.length() == 1); 566 text = code = codeStr[0]; 561 WebString webCodeStr = WebString::fromUTF8(codeStr.data(), codeStr.size()); 562 ASSERT(webCodeStr.length() == 1); 563 text = code = webCodeStr.data()[0]; 567 564 needsShiftKeyModifier = needsShiftModifier(code); 568 565 if ((code & 0xFF) >= 'a' && (code & 0xFF) <= 'z') … … 614 611 string editCommand; 615 612 if (getEditCommand(eventDown, &editCommand)) 616 testShell-> delegate()->setEditCommand(editCommand, "");613 testShell->webViewHost()->setEditCommand(editCommand, ""); 617 614 618 615 webview()->handleInputEvent(eventDown); 619 616 620 testShell-> delegate()->clearEditCommand();617 testShell->webViewHost()->clearEditCommand(); 621 618 622 619 if (generateChar) { … … 765 762 result->setNull(); 766 763 767 MessageLoop::current()->PostTask( 768 FROM_HERE, m_methodFactory.NewRunnableMethod( 764 webkit_support::PostTaskFromHere(m_methodFactory.NewRunnableMethod( 769 765 &EventSender::mouseDown, arguments, static_cast<CppVariant*>(0))); 770 MessageLoop::current()->PostTask( 771 FROM_HERE, m_methodFactory.NewRunnableMethod( 766 webkit_support::PostTaskFromHere(m_methodFactory.NewRunnableMethod( 772 767 &EventSender::mouseUp, arguments, static_cast<CppVariant*>(0))); 773 }774 775 static WebString filePathStringToWebString(const FilePath::StringType& pathString)776 {777 #if OS(UNIX)778 return WideToUTF16Hack(SysNativeMBToWide(pathString));779 #elif OS(WINDOWS)780 return WebString(pathString);781 #endif782 768 } 783 769 … … 786 772 currentDragData.initialize(); 787 773 Vector<string> files = arguments[0].toStringVector(); 788 for (size_t i = 0; i < files.size(); ++i) { 789 FilePath path(files[i]); 790 file_util::AbsolutePath(&path); 791 currentDragData.appendToFileNames(filePathStringToWebString(path.value())); 792 } 774 for (size_t i = 0; i < files.size(); ++i) 775 currentDragData.appendToFileNames(webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i])); 793 776 currentDragEffectsAllowed = WebKit::WebDragOperationCopy; 794 777 -
trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
r56612 r57188 545 545 { 546 546 if (arguments.size() > 0 && arguments[0].isString()) { 547 m_userStyleSheetLocation = WebURL(GURL(TestShell::rewriteLocalUrl(arguments[0].toString())));547 m_userStyleSheetLocation = webkit_support::RewriteLayoutTestsURL(arguments[0].toString()); 548 548 m_shell->webView()->settings()->setUserStyleSheetLocation(m_userStyleSheetLocation); 549 549 } … … 657 657 while (StartsWithASCII(url, "file:////", false)) 658 658 url = url.substr(0, 8) + url.substr(9); 659 GURL location(TestShell::rewriteLocalUrl(url)); 660 result->set(location.spec()); 659 result->set(webkit_support::RewriteLayoutTestsURL(url).spec()); 661 660 } 662 661 -
trunk/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
r55712 r57188 33 33 34 34 #include "TestShell.h" 35 #include "base/string_util.h"36 35 #include "public/WebFrame.h" 37 36 #include "public/WebRange.h" 38 37 #include "public/WebString.h" 39 38 #include "public/WebView.h" 39 #include <string> 40 40 41 41 using namespace WebKit; 42 using namespace std; 42 43 43 44 TestShell* TextInputController::testShell = 0; … … 165 166 166 167 WebRange range = mainFrame->markedRange(); 167 result->set(StringPrintf("%d,%d", range.startOffset(), range.endOffset())); 168 char buffer[30]; 169 snprintf(buffer, 30, "%d,%d", range.startOffset(), range.endOffset()); 170 result->set(string(buffer)); 168 171 } 169 172 … … 177 180 178 181 WebRange range = mainFrame->selectionRange(); 179 result->set(StringPrintf("%d,%d", range.startOffset(), range.endOffset())); 182 char buffer[30]; 183 snprintf(buffer, 30, "%d,%d", range.startOffset(), range.endOffset()); 184 result->set(string(buffer)); 180 185 } 181 186
Note: See TracChangeset
for help on using the changeset viewer.