Changeset 181914 in webkit
- Timestamp:
- Mar 24, 2015 3:56:03 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp
r181670 r181914 29 29 #if OS(DARWIN) 30 30 31 #include "JSContextRefPrivate.h" 31 32 #include "JavaScriptCore.h" 32 33 … … 36 37 #include <sys/time.h> 37 38 38 static JSGlobalContextRef * currentContextForAssertion= nullptr;39 static JSGlobalContextRef context = nullptr; 39 40 40 41 static double currentCPUTime() … … 62 63 UNUSED_PARAM(exception); 63 64 64 ASSERT(JSContextGetGlobalContext(ctx) == *currentContextForAssertion);65 ASSERT(JSContextGetGlobalContext(ctx) == context); 65 66 return JSValueMakeNumber(ctx, currentCPUTime()); 66 67 } … … 98 99 99 100 100 int testExecutionTimeLimit(JSGlobalContextRef* globalContext) 101 { 102 JSGlobalContextRef& context = *globalContext; 103 currentContextForAssertion = globalContext; 101 int testExecutionTimeLimit() 102 { 103 context = JSGlobalContextCreateInGroup(nullptr, nullptr); 104 104 105 105 JSContextGroupRef contextGroup = JSContextGetGroup(context); … … 262 262 } 263 263 264 JSGlobalContextRelease(context); 264 265 return failed; 265 266 } -
trunk/Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.h
r181670 r181914 27 27 #define ExecutionTimeLimitTest_h 28 28 29 #include "JSContextRefPrivate.h"30 31 29 #ifdef __cplusplus 32 30 extern "C" { … … 34 32 35 33 /* Returns 1 if failures were encountered. Else, returns 0. */ 36 int testExecutionTimeLimit( JSGlobalContextRef*);37 34 int testExecutionTimeLimit(); 35 38 36 #ifdef __cplusplus 39 37 } /* extern "C" */ -
trunk/Source/JavaScriptCore/API/tests/testapi.c
r181810 r181914 1858 1858 1859 1859 #if OS(DARWIN) 1860 failed = testExecutionTimeLimit( &context) || failed;1860 failed = testExecutionTimeLimit() || failed; 1861 1861 #endif /* OS(DARWIN) */ 1862 1862 failed = testGlobalContextWithFinalizer() || failed; -
trunk/Source/JavaScriptCore/ChangeLog
r181901 r181914 1 2015-03-24 Mark Lam <mark.lam@apple.com> 2 3 The ExecutionTimeLimit test should use its own JSGlobalContextRef. 4 <https://webkit.org/b/143024> 5 6 Reviewed by Geoffrey Garen. 7 8 Currently, the ExecutionTimeLimit test is using a JSGlobalContextRef 9 passed in from testapi.c. It should create its own for better 10 encapsulation of the test. 11 12 * API/tests/ExecutionTimeLimitTest.cpp: 13 (currentCPUTimeAsJSFunctionCallback): 14 (testExecutionTimeLimit): 15 * API/tests/ExecutionTimeLimitTest.h: 16 * API/tests/testapi.c: 17 (main): 18 1 19 2015-03-24 Joseph Pecoraro <pecoraro@apple.com> 2 20
Note: See TracChangeset
for help on using the changeset viewer.