Changeset 88726 in webkit
- Timestamp:
- Jun 13, 2011 3:50:53 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r88714 r88726 1 2011-06-13 Chris Rogers <crogers@google.com> 2 3 Reviewed by Dirk Pranke. 4 5 Add Web Audio support to chromium DRT 6 https://bugs.webkit.org/show_bug.cgi?id=62306 7 8 * DumpRenderTree/chromium/LayoutTestController.cpp: 9 (LayoutTestController::LayoutTestController): 10 (LayoutTestController::reset): 11 (LayoutTestController::setEncodedAudioData): 12 * DumpRenderTree/chromium/LayoutTestController.h: 13 (LayoutTestController::encodedAudioData): 14 (LayoutTestController::shouldDumpAsAudio): 15 (LayoutTestController::setShouldDumpAsAudio): 16 * DumpRenderTree/chromium/TestEventPrinter.cpp: 17 (DRTPrinter::handleAudioHeader): 18 (TestShellPrinter::handleAudioHeader): 19 * DumpRenderTree/chromium/TestEventPrinter.h: 20 * DumpRenderTree/chromium/TestShell.cpp: 21 (TestShell::TestShell): 22 (TestShell::dump): 23 1 24 2011-06-13 Jaehun Lim <ljaehun.lim@samsung.com> 2 25 -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
r88377 r88726 157 157 bindMethod("setDomainRelaxationForbiddenForURLScheme", &LayoutTestController::setDomainRelaxationForbiddenForURLScheme); 158 158 bindMethod("setEditingBehavior", &LayoutTestController::setEditingBehavior); 159 bindMethod("setEncodedAudioData", &LayoutTestController::setEncodedAudioData); 159 160 bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission); 160 161 bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled); … … 574 575 } 575 576 m_dumpAsText = false; 577 m_dumpAsAudio = false; 576 578 m_dumpEditingCallbacks = false; 577 579 m_dumpFrameLoadCallbacks = false; … … 1923 1925 m_shell->webView()->setTextDirection(direction); 1924 1926 } 1927 1928 void LayoutTestController::setEncodedAudioData(const CppArgumentList& arguments, CppVariant* result) 1929 { 1930 result->setNull(); 1931 if (arguments.size() < 1 || !arguments[0].isString()) 1932 return; 1933 1934 m_encodedAudioData = arguments[0].toString(); 1935 setShouldDumpAsAudio(true); 1936 } -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h
r88358 r88726 250 250 void setEditingBehavior(const CppArgumentList&, CppVariant*); 251 251 252 // Deals with Web Audio base64 encoded WAVE file data. 253 void setEncodedAudioData(const CppArgumentList&, CppVariant*); 254 const std::string& encodedAudioData() const { return m_encodedAudioData; } 255 252 256 // The following are only stubs. 253 257 // FIXME: Implement any of these that are needed to pass the layout tests. … … 399 403 400 404 WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*); 405 bool shouldDumpAsAudio() const { return m_dumpAsAudio; } 406 void setShouldDumpAsAudio(bool dumpAsAudio) { m_dumpAsAudio = dumpAsAudio; } 401 407 bool shouldDumpAsText() { return m_dumpAsText; } 402 408 void setShouldDumpAsText(bool value) { m_dumpAsText = value; } … … 519 525 bool m_dumpAsText; 520 526 527 // If true, the test_shell will output a base64 encoded WAVE file. 528 bool m_dumpAsAudio; 529 521 530 // If true, the test_shell will write a descriptive line for each editing 522 531 // command. … … 618 627 619 628 OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock; 629 630 // base64 encoded WAV audio data is stored here. 631 std::string m_encodedAudioData; 620 632 }; 621 633 -
trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp
r88246 r88726 43 43 void handleTextHeader() const; 44 44 void handleTextFooter() const; 45 void handleAudioHeader() const; 45 46 void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const; 46 47 void handleImageFooter() const; … … 55 56 void handleTextHeader() const; 56 57 void handleTextFooter() const; 58 void handleAudioHeader() const; 57 59 void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const; 58 60 void handleImageFooter() const; … … 94 96 { 95 97 printf("#EOF\n"); 98 } 99 100 void DRTPrinter::handleAudioHeader() const 101 { 102 printf("Content-Type: audio/wav\n"); 103 printf("Content-Transfer-Encoding: base64\n"); 96 104 } 97 105 … … 142 150 } 143 151 152 void TestShellPrinter::handleAudioHeader() const 153 { 154 printf("Content-Type: audio/wav\n"); 155 printf("Content-Transfer-Encoding: base64\n"); 156 } 157 144 158 void TestShellPrinter::handleImage(const char* actualHash, const char*, const unsigned char* imageData, size_t imageSize, const char* fileName) const 145 159 { -
trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.h
r88246 r88726 44 44 virtual void handleTextHeader() const = 0; 45 45 virtual void handleTextFooter() const = 0; 46 virtual void handleAudioHeader() const = 0; 46 47 virtual void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const = 0; 47 48 virtual void handleImageFooter() const = 0; -
trunk/Tools/DumpRenderTree/chromium/TestShell.cpp
r87948 r88726 116 116 WebRuntimeFeatures::enableFileSystem(true); 117 117 WebRuntimeFeatures::enableJavaScriptI18NAPI(true); 118 WebRuntimeFeatures::enableWebAudio(true); 119 118 120 m_webPermissions = adoptPtr(new WebPermissions()); 119 121 m_accessibilityController = adoptPtr(new AccessibilityController(this)); … … 462 464 return; 463 465 bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText(); 466 bool shouldDumpAsAudio = m_layoutTestController->shouldDumpAsAudio(); 464 467 bool shouldGeneratePixelResults = m_layoutTestController->shouldGeneratePixelResults(); 465 468 bool dumpedAnything = false; 469 470 if (shouldDumpAsAudio) { 471 m_printer->handleAudioHeader(); 472 473 const string& encodedAudioData = m_layoutTestController->encodedAudioData(); 474 if (fwrite(encodedAudioData.c_str(), 1, encodedAudioData.size(), stdout) != encodedAudioData.size()) 475 FATAL("Short write to stdout, disk full?\n"); 476 printf("\n"); 477 478 m_printer->handleTestFooter(true); 479 fflush(stdout); 480 fflush(stderr); 481 return; 482 } 483 466 484 if (m_params.dumpTree) { 467 485 dumpedAnything = true;
Note: See TracChangeset
for help on using the changeset viewer.