Skip to content

Instantly share code, notes, and snippets.

@vivekgalatage
Created September 18, 2012 06:49
Show Gist options
  • Save vivekgalatage/3741670 to your computer and use it in GitHub Desktop.
Save vivekgalatage/3741670 to your computer and use it in GitHub Desktop.
protocol-test.js
----------------
function runTest():
var url = scriptUrlBasePath + "/protocol-test.html";
var script = "(" + initialize_InspectorTest.toString() + ")();\n" + test.toString() + "";
var inspectorFrontend = window.internals.openDummyInspectorFrontend(url);
inspectorFrontend.postMessage(script, window.location.href);
protocol-test.html
-----------------
<html>
<head>
<script type="text/javascript" src="../../../../Source/WebCore/inspector/front-end/InspectorBackend.js"></script>
<script type="text/javascript">
function executeTestCase(testCase)
{
InspectorBackend.loadFromJSONIfNeeded("../../../../Source/WebCore/inspector/Inspector.json");
testCase();
}
window.addEventListener("message", function(event) {
eval(event.data);
executeTestCase(test);
});
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment