Changeset 80001 in webkit
- Timestamp:
- Mar 1, 2011 7:29:44 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r79999 r80001 1 2011-03-01 Adam Roben <aroben@apple.com> 2 3 Convert seconds to milliseconds before calling ::SetTimer 4 5 Fixes <http://webkit.org/b/55417> <rdar://problem/9065287> RunLoop::Timer fires 1000x too 6 early on Windows 7 8 Reviewed by Anders Carlsson. 9 10 * Platform/win/RunLoopWin.cpp: 11 (RunLoop::TimerBase::start): Convert the timeout interval to milliseconds, since that's what 12 ::SetTimer expects. 13 1 14 2011-03-01 Andras Becsi <abecsi@webkit.org> 2 15 -
trunk/Source/WebKit2/Platform/win/RunLoopWin.cpp
r77939 r80001 157 157 m_isRepeating = repeat; 158 158 m_runLoop->m_activeTimers.set(m_ID, this); 159 ::SetTimer(m_runLoop->m_runLoopMessageWindow, m_ID, nextFireInterval , 0);159 ::SetTimer(m_runLoop->m_runLoopMessageWindow, m_ID, nextFireInterval * 1000, 0); 160 160 } 161 161 -
trunk/Tools/ChangeLog
r79999 r80001 1 2011-03-01 Adam Roben <aroben@apple.com> 2 3 Test that the WebKit2 responsiveness timer doesn't fire too early 4 5 Test for <http://webkit.org/b/55417> <rdar://problem/9065287> RunLoop::Timer fires 1000x too 6 early on Windows 7 8 Reviewed by Anders Carlsson. 9 10 * TestWebKitAPI/PlatformUtilities.h: Added sleep(). 11 12 * TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly.cpp: Added. 13 (TestWebKitAPI::didReceiveMessageFromInjectedBundle): 14 (TestWebKitAPI::didFinishLoadForFrame): 15 (TestWebKitAPI::processDidBecomeUnresponsive): 16 (TestWebKitAPI::setInjectedBundleClient): 17 (TestWebKitAPI::setPageLoaderClient): 18 Simple helper functions. 19 20 (TestWebKitAPI::TEST): Load an HTML file to make sure the web process is initialized. Then 21 tell the web process to pause and press the spacebar key. The spacebar keypress should cause 22 the responsiveness timer to start, but the web process should unpause before it has a chance 23 to fire. Run until the web process has unpaused, and assert that the timer didn't fire. 24 25 * TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp: Added. 26 (TestWebKitAPI::ResponsivenessTimerDoesntFireEarlyTest::ResponsivenessTimerDoesntFireEarlyTest): 27 Call up to the base class. 28 (TestWebKitAPI::ResponsivenessTimerDoesntFireEarlyTest::didReceiveMessage): When asked to 29 pause, sleep for 0.5 seconds, then send back a message saying we paused. 30 31 * TestWebKitAPI/mac/PlatformUtilitiesMac.mm: 32 (TestWebKitAPI::Util::sleep): Added. Calls through to usleep. 33 * TestWebKitAPI/win/PlatformUtilitiesWin.cpp: 34 (TestWebKitAPI::Util::sleep): Added. Calls through to ::Sleep. 35 36 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 37 * TestWebKitAPI/win/TestWebKitAPI.vcproj: 38 * TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj: 39 Added new files. 40 1 41 2011-03-01 Andras Becsi <abecsi@webkit.org> 2 42 -
trunk/Tools/TestWebKitAPI/PlatformUtilities.h
r73336 r80001 37 37 void run(bool* done); 38 38 39 void sleep(double seconds); 40 39 41 WKContextRef createContextForInjectedBundleTest(const std::string&, WKTypeRef userData = 0); 40 42 … … 48 50 WKRetainPtr<WKStringRef> toWK(const char* utf8String); 49 51 50 51 52 template<typename T> static inline WKRetainPtr<T> adoptWK(T item) 52 53 { -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r79966 r80001 53 53 C0ADBE8312FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0ADBE8212FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp */; }; 54 54 C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C0ADBE8412FCA6B600D2C129 /* simple-form.html */; }; 55 C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */; }; 56 C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */; }; 55 57 /* End PBXBuildFile section */ 56 58 … … 150 152 C0ADBE8212FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RestoreSessionStateContainingFormData.cpp; sourceTree = "<group>"; }; 151 153 C0ADBE8412FCA6B600D2C129 /* simple-form.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-form.html"; sourceTree = "<group>"; }; 154 C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly.cpp; sourceTree = "<group>"; }; 155 C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly_Bundle.cpp; sourceTree = "<group>"; }; 152 156 /* End PBXFileReference section */ 153 157 … … 269 273 BC2D004812A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp */, 270 274 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */, 275 C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */, 276 C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */, 271 277 C0ADBE8212FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp */, 272 278 C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */, … … 423 429 1ADBEFAE130C689C00D61D19 /* ForceRepaint.cpp in Sources */, 424 430 4BFDFFA9131477770061F24B /* HitTestResultNodeHandle.cpp in Sources */, 431 C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */, 425 432 ); 426 433 runOnlyForDeploymentPostprocessing = 0; … … 437 444 BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */, 438 445 4BFDFFA71314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp in Sources */, 446 C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */, 439 447 ); 440 448 runOnlyForDeploymentPostprocessing = 0; -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
r80000 r80001 1 1 /* 2 * Copyright (C) 201 0Apple Inc. All rights reserved.2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef PlatformUtilities_h 27 #define PlatformUtilities_h 26 #include "InjectedBundleTest.h" 28 27 29 #include <WebKit2/WebKit2.h> 30 #include <WebKit2/WKRetainPtr.h> 31 #include <string> 28 #include "PlatformUtilities.h" 32 29 33 30 namespace TestWebKitAPI { 34 namespace Util {35 31 36 // Runs a platform runloop until the 'done' is true. 37 void run(bool* done); 32 class ResponsivenessTimerDoesntFireEarlyTest : public InjectedBundleTest { 33 public: 34 ResponsivenessTimerDoesntFireEarlyTest(const std::string& identifier); 38 35 39 WKContextRef createContextForInjectedBundleTest(const std::string&, WKTypeRef userData = 0); 36 private: 37 virtual void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody); 38 }; 40 39 41 WKStringRef createInjectedBundlePath(); 42 WKURLRef createURLForResource(const char* resource, const char* extension); 43 WKURLRef URLForNonExistentResource(); 40 static InjectedBundleTest::Register<ResponsivenessTimerDoesntFireEarlyTest> registrar("ResponsivenessTimerDoesntFireEarlyTest"); 44 41 45 bool isKeyDown(WKNativeEventPtr); 46 47 std::string toSTD(WKStringRef string); 48 WKRetainPtr<WKStringRef> toWK(const char* utf8String); 49 50 51 template<typename T> static inline WKRetainPtr<T> adoptWK(T item) 42 ResponsivenessTimerDoesntFireEarlyTest::ResponsivenessTimerDoesntFireEarlyTest(const std::string& identifier) 43 : InjectedBundleTest(identifier) 52 44 { 53 return WKRetainPtr<T>(AdoptWK, item);54 45 } 55 46 56 } // namespace Util 47 void ResponsivenessTimerDoesntFireEarlyTest::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef) 48 { 49 if (!WKStringIsEqualToUTF8CString(messageName, "BrieflyPause")) 50 return; 51 52 // The responsiveness timer is a 3-second timer. Pausing for 0.5 seconds should not cause it to fire. 53 Util::sleep(0.5); 54 55 WKBundlePostMessage(bundle, Util::toWK("DidBrieflyPause").get(), 0); 56 } 57 57 58 } // namespace TestWebKitAPI 58 59 #endif // PlatformUtilities_h -
trunk/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
r70352 r80001 40 40 } 41 41 42 void sleep(double seconds) 43 { 44 usleep(seconds * 1000000); 45 } 46 42 47 WKStringRef createInjectedBundlePath() 43 48 { -
trunk/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp
r79938 r80001 51 51 } 52 52 53 void sleep(double seconds) 54 { 55 ::Sleep(seconds * 1000); 56 } 57 53 58 RetainPtr<CFStringRef> cf(const char* utf8String) 54 59 { -
trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj
r79966 r80001 473 473 </File> 474 474 <File 475 RelativePath="..\Tests\WebKit2\ResponsivenessTimerDoesntFireEarly.cpp" 476 > 477 </File> 478 <File 475 479 RelativePath="..\Tests\WebKit2\RestoreSessionStateContainingFormData.cpp" 476 480 > -
trunk/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj
r79966 r80001 412 412 > 413 413 </File> 414 <File 415 RelativePath="..\Tests\WebKit2\ResponsivenessTimerDoesntFireEarly_Bundle.cpp" 416 > 417 </File> 414 418 </Filter> 415 419 </Filter>
Note: See TracChangeset
for help on using the changeset viewer.