Changeset 188598 in webkit
- Timestamp:
- Aug 18, 2015, 2:53:23 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 32 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r188597 r188598 1 2015-08-18 Brian Burg <bburg@apple.com> 2 3 Web Inspector: load ProtocolTestStub from the WebInspectorUI bundle 4 https://bugs.webkit.org/show_bug.cgi?id=147955 5 6 Reviewed by Timothy Hatcher. 7 8 Since the inspector stub cannot open files that live in the LayoutTests 9 directory, adopt the test helper marshalling approach used by inspector.js. 10 Each helper must register its code for marshalling and explicitly put globals 11 on the window object. 12 13 Use script tags rather than importScript to include helpers in a test. 14 15 * TestExpectations: For now, skip inspector http tests. These should be rewritten 16 to use inspector-test.js, which does not run into cross-origin problems. 17 18 Rebaseline some test results to account for shifted line numbers (yuck). 19 20 * http/tests/inspector/dom/resources/InspectorDOMListener.js: 21 * http/tests/inspector/resources/console-test.js: 22 * http/tests/inspector/resources/probe-test.js: 23 * http/tests/inspector/resources/protocol-test.js: 24 (ProtocolTestProxy.registerInitializer): 25 (log): 26 (runTest.runInitializationMethodsInFrontend): 27 (runTest.runTestMethodInFrontend): 28 (runTest): 29 * inspector/console/console-message.html: 30 * inspector/console/css-source-locations-expected.txt: 31 * inspector/console/css-source-locations.html: 32 * inspector/console/js-source-locations-expected.txt: 33 * inspector/console/js-source-locations.html: 34 * inspector/console/x-frame-options-message-expected.txt: 35 * inspector/console/x-frame-options-message.html: 36 * inspector/debugger/didSampleProbe-multiple-probes.html: 37 * inspector/debugger/setBreakpoint-actions.html: 38 * inspector/debugger/setBreakpoint-options-exception.html: 39 * inspector/dom/dom-search-expected.txt: 40 * inspector/dom/dom-search-with-context.html: 41 * inspector/dom/dom-search.html: 42 * inspector/dom/resources/dom-search-queries.js: 43 1 44 2015-08-18 Myles C. Maxfield <mmaxfield@apple.com> 2 45 -
trunk/LayoutTests/TestExpectations
r188579 r188598 94 94 95 95 webkit.org/b/129057 media/controls-styling-strict.html [ Pass Failure ] 96 97 # These tests will be rewritten, just skip them until that time. 98 webkit.org/b/148036 http/tests/inspector/ [ Skip ] 96 99 97 100 webkit.org/b/129639 inspector/dom/dom-search-crash.html [ Skip ] -
trunk/LayoutTests/http/tests/inspector/dom/resources/InspectorDOMListener.js
r188579 r188598 28 28 */ 29 29 30 function createDOMListener() 30 ProtocolTestProxy.registerInitializer(function(){ 31 32 window.createDOMListener = function() 31 33 { 32 34 var nodesById = {}; … … 102 104 }; 103 105 } 106 107 }); -
trunk/LayoutTests/http/tests/inspector/resources/console-test.js
r188579 r188598 1 ProtocolTestProxy.registerInitializer(function() { 2 1 3 ProtocolTest.Console = {}; 2 4 … … 74 76 }); 75 77 } 78 79 }); -
trunk/LayoutTests/http/tests/inspector/resources/probe-test.js
r188579 r188598 1 ProtocolTestProxy.registerInitializer(function() { 2 1 3 ProtocolTest.Probe = {}; 2 4 … … 126 128 }); 127 129 } 130 131 }); -
trunk/LayoutTests/http/tests/inspector/resources/protocol-test.js
r188579 r188598 24 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 25 */ 26 var outputElement; 26 27 // This namespace is injected into every test page. Its functions are invoked by 28 // ProtocolTest methods on the inspector page via InjectedTestHarness. 29 ProtocolTestProxy = {}; 30 ProtocolTestProxy._initializers = []; 31 32 // Helper scripts like `console-test.js` must register their initialization 33 // function with this method so it will be marshalled to the inspector page. 34 ProtocolTestProxy.registerInitializer = function(initializer) 35 { 36 if (typeof initializer === "function") 37 this._initializers.push(initializer.toString()); 38 } 39 40 let outputElement; 27 41 28 42 /** … … 41 55 { 42 56 if (!outputElement) { 43 varintermediate = document.createElement("div");57 let intermediate = document.createElement("div"); 44 58 document.body.appendChild(intermediate); 45 59 46 varintermediate2 = document.createElement("div");60 let intermediate2 = document.createElement("div"); 47 61 intermediate.appendChild(intermediate2); 48 62 … … 78 92 testRunner.setCanOpenWindows(true); 79 93 80 var scriptTags = document.getElementsByTagName("script"); 81 var scriptUrlBasePath = ""; 82 for (var i = 0; i < scriptTags.length; ++i) { 83 var index = scriptTags[i].src.lastIndexOf("/protocol-test.js"); 84 if (index > -1 ) { 85 scriptUrlBasePath = scriptTags[i].src.slice(0, index); 86 break; 94 let testFunction = window.test; 95 if (!(typeof testFunction === "function")) { 96 alert("Failed to send test() because it is not a function."); 97 testRunner.notifyDone(); 98 } 99 100 let url = testRunner.inspectorTestStubURL; 101 if (!url) { 102 alert("Failed to obtain inspector test stub URL."); 103 testRunner.notifyDone(); 104 } 105 106 function runInitializationMethodsInFrontend(initializers) 107 { 108 for (let initializer of initializers) { 109 try { 110 initializer(); 111 } catch (e) { 112 ProtocolTest.log("Exception in test initialization: " + e, e.stack || "(no stack trace)"); 113 ProtocolTest.completeTest(); 114 } 87 115 } 88 116 } 89 117 90 var url = scriptUrlBasePath + "/ProtocolTestStub.html"; 91 var inspectorFrontend = window.internals.openDummyInspectorFrontend(url); 118 function runTestMethodInFrontend(testFunction) 119 { 120 try { 121 testFunction(); 122 } catch (e) { 123 ProtocolTest.log("Exception during test execution: " + e, e.stack || "(no stack trace)"); 124 ProtocolTest.completeTest(); 125 } 126 } 127 128 let inspectorFrontend = window.internals.openDummyInspectorFrontend(url); 92 129 inspectorFrontend.addEventListener("load", function(event) { 93 // FIXME: rename this 'test' global field across all tests. 94 var testFunction = window.test; 95 if (typeof testFunction === "function") { 96 inspectorFrontend.postMessage("(" + testFunction.toString() +")();", "*"); 97 return; 98 } 99 // Kill waiting process if failed to send. 100 alert("Failed to send test function"); 101 testRunner.notifyDone(); 130 let initializationCodeString = `(${runInitializationMethodsInFrontend.toString()})([${ProtocolTestProxy._initializers}]);`; 131 let testFunctionCodeString = `(${runTestMethodInFrontend.toString()})(${testFunction.toString()});`; 132 133 inspectorFrontend.postMessage(initializationCodeString, "*"); 134 inspectorFrontend.postMessage(testFunctionCodeString, "*"); 102 135 }); 103 136 } -
trunk/LayoutTests/inspector/console/console-message.html
r188579 r188598 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/protocol-test.js"></script> 5 <script src="../../http/tests/inspector/resources/console-test.js"></script> 5 6 <script> 6 7 function generateSimpleConsoleMessages() … … 15 16 function test() 16 17 { 17 ProtocolTest.importScript("console-test.js");18 18 19 19 var suite = ProtocolTest.createAsyncSuite("Console.MessagesFromCommandLineAPI"); -
trunk/LayoutTests/inspector/console/css-source-locations-expected.txt
r188579 r188598 1 1 Tests that CSS parser warnings from inline style tags and external stylesheets are sent to the console with correct line and column information. 2 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html: 6:20"}3 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html: 7:14"}4 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html: 8:7"}5 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html:1 0:8"}2 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html:7:20"} 3 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html:8:14"} 4 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html:9:7"} 5 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"css-source-locations.html:11:8"} 6 6 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"errors.css:1:7"} 7 7 {"source":"css","level":"warning","text":"Invalid CSS property declaration at: *","location":"errors.css:1:29"} -
trunk/LayoutTests/inspector/console/css-source-locations.html
r188579 r188598 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/protocol-test.js"></script> 5 <script src="../../http/tests/inspector/resources/console-test.js"></script> 5 6 <link rel="stylesheet" href="resources/errors.css"> 6 7 <style> div { * color: red; }</style> … … 16 17 function test() 17 18 { 18 ProtocolTest.importScript("console-test.js");19 20 19 var consoleMessageCount = 0; 21 20 const expectedConsoleMessageCount = 7; -
trunk/LayoutTests/inspector/console/js-source-locations-expected.txt
r188579 r188598 3 3 CONSOLE MESSAGE: line 5: error script 4 4 CONSOLE MESSAGE: line 6: warn script 5 CONSOLE MESSAGE: line 6: TypeError: undefined is not an object (evaluating '[].x.x')6 CONSOLE MESSAGE: line 8: warn 17 CONSOLE MESSAGE: line 8: error 18 CONSOLE MESSAGE: line 9: error 25 CONSOLE MESSAGE: line 7: TypeError: undefined is not an object (evaluating '[].x.x') 6 CONSOLE MESSAGE: line 9: warn 1 7 CONSOLE MESSAGE: line 9: error 1 8 CONSOLE MESSAGE: line 10: error 2 9 9 Tests that JavaScript errors and warnings from inline script tags and external files are sent to the console with correct line and column information. 10 10 {"source":"console-api","level":"error","text":"error script","location":"errors.js:1:14","parameters":[{"type":"string"}]} … … 12 12 {"source":"console-api","level":"error","text":"error script","location":"errors.js:5:18","parameters":[{"type":"string"}]} 13 13 {"source":"console-api","level":"warning","text":"warn script","location":"errors.js:6:17","parameters":[{"type":"string"}]} 14 {"source":"javascript","level":"error","text":"TypeError: undefined is not an object (evaluating '[].x.x')","location":"js-source-locations.html: 6:18"}15 {"source":"console-api","level":"warning","text":"warn 1","location":"js-source-locations.html: 8:13","parameters":[{"type":"string"}]}16 {"source":"console-api","level":"error","text":"error 1","location":"js-source-locations.html: 8:38","parameters":[{"type":"string"}]}17 {"source":"console-api","level":"error","text":"error 2","location":"js-source-locations.html: 9:17","parameters":[{"type":"string"}]}14 {"source":"javascript","level":"error","text":"TypeError: undefined is not an object (evaluating '[].x.x')","location":"js-source-locations.html:7:18"} 15 {"source":"console-api","level":"warning","text":"warn 1","location":"js-source-locations.html:9:13","parameters":[{"type":"string"}]} 16 {"source":"console-api","level":"error","text":"error 1","location":"js-source-locations.html:9:38","parameters":[{"type":"string"}]} 17 {"source":"console-api","level":"error","text":"error 2","location":"js-source-locations.html:10:17","parameters":[{"type":"string"}]} 18 18 -
trunk/LayoutTests/inspector/console/js-source-locations.html
r188579 r188598 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/protocol-test.js"></script> 5 <script src="../../http/tests/inspector/resources/console-test.js"></script> 5 6 <script src="resources/errors.js"></script> 6 7 <script> [].x.x </script> … … 12 13 function test() 13 14 { 14 ProtocolTest.importScript("console-test.js");15 16 15 var consoleMessageCount = 0; 17 16 const expectedConsoleMessageCount = 8; -
trunk/LayoutTests/inspector/console/x-frame-options-message-expected.txt
r188579 r188598 1 CONSOLE MESSAGE: line 4 2: Refused to display 'x-frame-options-message.html' in a frame because it set 'X-Frame-Options' to 'deny'.1 CONSOLE MESSAGE: line 41: Refused to display 'x-frame-options-message.html' in a frame because it set 'X-Frame-Options' to 'deny'. 2 2 3 3 -
trunk/LayoutTests/inspector/console/x-frame-options-message.html
r188579 r188598 3 3 <head> 4 4 <script src="../../http/tests/inspector/resources/protocol-test.js"></script> 5 <script src="../../http/tests/inspector/resources/console-test.js"></script> 5 6 <script> 6 7 function test() 7 8 { 8 ProtocolTest.importScript("console-test.js");9 10 9 let suite = ProtocolTest.createAsyncSuite("Console.XFrameOptionsMessages"); 11 10 -
trunk/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html
r188579 r188598 2 2 <head> 3 3 <script src="../../http/tests/inspector/resources/protocol-test.js"></script> 4 <script src="../../http/tests/inspector/resources/probe-test.js"></script> 4 5 <script src="resources/breakpoint.js"></script> 5 6 <script> 6 7 function test() 7 8 { 8 ProtocolTest.importScript("probe-test.js");9 10 9 InspectorProtocol.sendCommand("Debugger.enable", {}); 11 10 -
trunk/LayoutTests/inspector/debugger/setBreakpoint-actions.html
r188579 r188598 2 2 <head> 3 3 <script src="../../http/tests/inspector/resources/protocol-test.js"></script> 4 <script src="../../http/tests/inspector/resources/console-test.js"></script> 5 <script src="../../http/tests/inspector/resources/probe-test.js"></script> 4 6 <script src="resources/breakpoint.js"></script> 5 7 <script> 6 8 function test() 7 9 { 8 ProtocolTest.importScript("console-test.js");9 ProtocolTest.importScript("probe-test.js");10 11 10 InspectorProtocol.sendCommand("Console.enable", {}); 12 11 InspectorProtocol.sendCommand("Debugger.enable", {}); -
trunk/LayoutTests/inspector/debugger/setBreakpoint-options-exception.html
r188579 r188598 2 2 <head> 3 3 <script src="../../http/tests/inspector/resources/protocol-test.js"></script> 4 <script src="../../http/tests/inspector/resources/console-test.js"></script> 4 5 <script src="resources/breakpoint.js"></script> 5 6 <script> 6 7 function test() 7 8 { 8 ProtocolTest.importScript("console-test.js");9 10 9 InspectorProtocol.sendCommand("Console.enable", {}); 11 10 InspectorProtocol.sendCommand("Debugger.enable", {}); -
trunk/LayoutTests/inspector/dom/dom-search-expected.txt
r188579 r188598 49 49 Count: 0 50 50 === Query: "*" === 51 Count: 1 251 Count: 14 52 52 html 53 53 head 54 script 55 script 54 56 script 55 57 script -
trunk/LayoutTests/inspector/dom/dom-search-with-context.html
r188579 r188598 2 2 <head> 3 3 <script type="text/javascript" src="../../http/tests/inspector/resources/protocol-test.js"></script> 4 <script type="text/javascript" src="../../http/tests/inspector/dom/resources/InspectorDOMListener.js"></script> 4 5 <script> 5 6 function test() 6 7 { 7 8 // Create a DOM listener to convert nodeIds to tag names. 8 ProtocolTest.importScript("../dom/resources/InspectorDOMListener.js");9 9 var dom = createDOMListener(); 10 10 -
trunk/LayoutTests/inspector/dom/dom-search.html
r188579 r188598 2 2 <head> 3 3 <script type="text/javascript" src="../../http/tests/inspector/resources/protocol-test.js"></script> 4 <script type="text/javascript" src="../../http/tests/inspector/dom/resources/InspectorDOMListener.js"></script> 5 <!-- Loading the queries from external file to avoid having them show up in the results. --> 6 <script type="text/javascript" src="resources/dom-search-queries.js"></script> 4 7 <script> 5 8 function test() 6 9 { 7 // Loading the queries from external file to avoid having them show up in the results.8 ProtocolTest.importScript("../../../../inspector/dom/resources/dom-search-queries.js");9 10 10 // Create a DOM listener to convert nodeIds to tag names. 11 ProtocolTest.importScript("../dom/resources/InspectorDOMListener.js");12 11 var dom = createDOMListener(); 13 12 -
trunk/LayoutTests/inspector/dom/resources/dom-search-queries.js
r188579 r188598 1 ProtocolTestProxy.registerInitializer(function() { 2 1 3 // Having the queries in an external file, so that DOM search will not find the script when searching for values. 2 4 3 vardomSearchQueries = [5 window.domSearchQueries = [ 4 6 "body", 5 7 "<body", … … 30 32 "/HTML/BODY" 31 33 ]; 34 35 }); -
trunk/Source/WebInspectorUI/ChangeLog
r188586 r188598 1 2015-08-18 Brian Burg <bburg@apple.com> 2 3 Web Inspector: load ProtocolTestStub from the WebInspectorUI bundle 4 https://bugs.webkit.org/show_bug.cgi?id=147955 5 6 Reviewed by Timothy Hatcher. 7 8 Move ProtocolTestStub.{html,js} into the actual WebInspectorUI project. 9 10 * UserInterface/Base/TestStub.js: Renamed from LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js. 11 * UserInterface/TestStub.html: Renamed from LayoutTests/http/tests/inspector/resources/ProtocolTestStub.html. 12 1 13 2015-08-18 Devin Rousso <drousso@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Base/TestStub.js
r188597 r188598 64 64 } 65 65 66 importScript(scriptName)67 {68 var xhr = new XMLHttpRequest();69 var isAsyncRequest = false;70 xhr.open("GET", scriptName, isAsyncRequest);71 xhr.send(null);72 if (xhr.status !== 0 && xhr.status !== 200)73 throw new Error("Invalid script URL: " + scriptName);74 var script = `// From InjectedTestHarness.importScript(${scriptName})75 try {76 ${xhr.responseText}77 } catch (e) {78 alert(${JSON.stringify("Error in: " + scriptName)});79 throw e;80 }`;81 window.eval(script);82 }83 84 66 get logCount() 85 67 { -
trunk/Source/WebInspectorUI/UserInterface/TestStub.html
r188597 r188598 1 1 <!-- 2 Copyright (C) 2012 Samsung Electronics. All rights reserved.3 2 Copyright (C) 2015 Apple Inc. All rights reserved. 4 3 … … 26 25 <html> 27 26 <head> 28 <script type="text/javascript" src=" ProtocolTestStub.js"></script>27 <script type="text/javascript" src="Base/TestStub.js"></script> 29 28 </head> 30 29 </html> -
trunk/Tools/ChangeLog
r188596 r188598 1 2015-08-18 Brian Burg <bburg@apple.com> 2 3 Web Inspector: load ProtocolTestStub from the WebInspectorUI bundle 4 https://bugs.webkit.org/show_bug.cgi?id=147955 5 6 Reviewed by Timothy Hatcher. 7 8 To enable sharing of common test code between protocol and model tests, 9 start loading the protocol TestStub.js through the WebInspectorUI bundle. 10 11 This patch adds the read-only getter TestRunner.inspectorTestStubURL, which 12 protocol-test.js uses to load the inspector frontend stub into its iframe 13 from an arbitrary local file URL. 14 15 * DumpRenderTree/TestRunner.cpp: 16 (getInspectorTestStubURLCallback): 17 (TestRunner::staticValues): 18 * DumpRenderTree/TestRunner.h: 19 * DumpRenderTree/mac/TestRunnerMac.mm: 20 (SOFT_LINK_STAGED_FRAMEWORK): 21 (TestRunner::inspectorTestStubURL): 22 * DumpRenderTree/win/TestRunnerWin.cpp: 23 (TestRunner::inspectorTestStubURL): 24 * WebKitTestRunner/Configurations/Base.xcconfig: 25 Since WebKitTestRunner now includes WebCore private headers, also search 26 for the WebCore framework inside the WebKit umbrella framework. 27 28 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 29 * WebKitTestRunner/InjectedBundle/TestRunner.h: 30 * WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp: 31 (WTR::TestRunner::inspectorTestStubURL): 32 * WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp: 33 (WTR::TestRunner::inspectorTestStubURL): 34 * WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm: 35 (WTR::TestRunner::inspectorTestStubURL): 36 1 37 2015-08-18 Filip Pizlo <fpizlo@apple.com> 2 38 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r188579 r188598 1791 1791 } 1792 1792 1793 static JSValueRef getInspectorTestStubURLCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) 1794 { 1795 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1796 JSRetainPtr<JSStringRef> url(Adopt, controller->inspectorTestStubURL()); 1797 return JSValueMakeString(context, url.get()); 1798 } 1799 1793 1800 static bool setGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) 1794 1801 { … … 1984 1991 { "databaseDefaultQuota", getDatabaseDefaultQuotaCallback, setDatabaseDefaultQuotaCallback, kJSPropertyAttributeNone }, 1985 1992 { "databaseMaxQuota", getDatabaseMaxQuotaCallback, setDatabaseMaxQuotaCallback, kJSPropertyAttributeNone }, 1993 { "inspectorTestStubURL", getInspectorTestStubURLCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1986 1994 { 0, 0, 0, 0 } 1987 1995 }; -
trunk/Tools/DumpRenderTree/TestRunner.h
r188579 r188598 309 309 void closeWebInspector(); 310 310 void evaluateInWebInspector(JSStringRef script); 311 JSStringRef inspectorTestStubURL(); 312 311 313 void evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script); 312 314 void evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script); -
trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm
r188579 r188598 44 44 #import <JavaScriptCore/JSStringRefCF.h> 45 45 #import <WebCore/GeolocationPosition.h> 46 #import <WebCore/SoftLinking.h> 46 47 #import <WebKit/DOMDocument.h> 47 48 #import <WebKit/DOMElement.h> … … 89 90 #endif 90 91 92 SOFT_LINK_STAGED_FRAMEWORK(WebInspectorUI, PrivateFrameworks, A) 93 91 94 #if !PLATFORM(IOS) 92 95 @interface CommandValidationTarget : NSObject <NSValidatedUserInterfaceItem> … … 781 784 } 782 785 786 JSStringRef TestRunner::inspectorTestStubURL() 787 { 788 // Call the soft link framework function to dlopen it, then CFBundleGetBundleWithIdentifier will work. 789 WebInspectorUILibrary(); 790 791 CFBundleRef inspectorBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebInspectorUI")); 792 if (!inspectorBundle) 793 return nullptr; 794 795 RetainPtr<CFURLRef> url = adoptCF(CFBundleCopyResourceURL(inspectorBundle, CFSTR("TestStub"), CFSTR("html"), NULL)); 796 if (!url) 797 return nullptr; 798 799 CFStringRef urlString = CFURLGetString(url.get()); 800 return JSStringCreateWithCFString(urlString); 801 } 802 783 803 typedef HashMap<unsigned, RetainPtr<WebScriptWorld> > WorldMap; 784 804 static WorldMap& worldMap() -
trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp
r188579 r188598 1094 1094 } 1095 1095 1096 JSStringRef TestRunner::inspectorTestStubURL() 1097 { 1098 // FIXME: Implement this to support Web Inspector tests using `protocol-test.js`. 1099 // See https://bugs.webkit.org/show_bug.cgi?id=148025. 1100 printf("ERROR: TestRunner::inspectorTestStubURL() not implemented\n"); 1101 1102 return nullptr; 1103 } 1104 1096 1105 typedef HashMap<unsigned, COMPtr<IWebScriptWorld> > WorldMap; 1097 1106 static WorldMap& worldMap() -
trunk/Tools/WebKitTestRunner/Configurations/Base.xcconfig
r184845 r188598 57 57 WEBCORE_PRIVATE_HEADERS_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders; 58 58 59 FRAMEWORK_SEARCH_PATHS = $(inherited) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks ;59 FRAMEWORK_SEARCH_PATHS = $(inherited) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks; 60 60 61 61 WEBKIT_SYSTEM_INTERFACE_LIBRARY = WebKitSystemInterface -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r188579 r188598 126 126 void closeWebInspector(); 127 127 void evaluateInWebInspector(DOMString script); 128 readonly attribute DOMString inspectorTestStubURL; 128 129 129 130 void setPOSIXLocale(DOMString locale); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r188579 r188598 200 200 void closeWebInspector(); 201 201 void evaluateInWebInspector(JSStringRef script); 202 JSRetainPtr<JSStringRef> inspectorTestStubURL(); 202 203 203 204 void setPOSIXLocale(JSStringRef); -
trunk/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp
r188579 r188598 24 24 #include <Ecore.h> 25 25 #include <JavaScriptCore/OpaqueJSString.h> 26 #include <WebCore/EflInspectorUtilities.h> 26 27 #include <wtf/text/CString.h> 28 #include <wtf/text/StringBuilder.h> 27 29 #include <wtf/text/WTFString.h> 28 30 … … 83 85 } 84 86 87 JSRetainPtr<JSStringRef> TestRunner::inspectorTestStubURL() 88 { 89 StringBuilder builder; 90 builder.append("file://"); 91 builder.append(WebCore::inspectorResourcePath()); 92 builder.appendLiteral("/TestStub.html"); 93 94 return JSStringCreateWithUTF8CString(builder.toString().utf8().data()); 95 } 96 85 97 } // namespace WTR -
trunk/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp
r188579 r188598 68 68 } 69 69 70 JSRetainPtr<JSStringRef> TestRunner::inspectorTestStubURL() 71 { 72 return JSStringCreateWithUTF8CString("resource:///org/webkitgtk/inspector/UserInterface/TestStub.html"); 73 } 74 70 75 } // namespace WTR -
trunk/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm
r188579 r188598 1 1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2015 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 #include "TestRunner.h" 26 #import "config.h" 27 #import "TestRunner.h" 27 28 28 #include "InjectedBundle.h" 29 #import "InjectedBundle.h" 30 #import <JavaScriptCore/JSStringRefCF.h> 31 #import <WebCore/SoftLinking.h> 32 33 SOFT_LINK_STAGED_FRAMEWORK(WebInspectorUI, PrivateFrameworks, A) 29 34 30 35 namespace WTR { … … 63 68 } 64 69 70 JSRetainPtr<JSStringRef> TestRunner::inspectorTestStubURL() 71 { 72 // Call the soft link framework function to dlopen it, then CFBundleGetBundleWithIdentifier will work. 73 WebInspectorUILibrary(); 74 75 CFBundleRef inspectorBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebInspectorUI")); 76 if (!inspectorBundle) 77 return nullptr; 78 79 RetainPtr<CFURLRef> url = adoptCF(CFBundleCopyResourceURL(inspectorBundle, CFSTR("TestStub"), CFSTR("html"), NULL)); 80 if (!url) 81 return nullptr; 82 83 CFStringRef urlString = CFURLGetString(url.get()); 84 return adopt(JSStringCreateWithCFString(urlString)); 85 } 86 65 87 } // namespace WTR
Note:
See TracChangeset
for help on using the changeset viewer.