https://bugs.webkit.org/show_bug.cgi?id=127707
Reviewed by Timothy Hatcher.
The test harness was setting up managers and observers before
telling the frontend host that the page loaded. The InspectorObserver
was also not being initialized.
For clarity, rename importInspectorScripts to initializeInspectorModels.
For easier debugging, make model test assertions use InspectorTest.log.
* http/tests/inspector-protocol/resources/InspectorTest.js:
(InspectorTest.initializeInspectorModels.console.error.window.onerror):
(InspectorTest.initializeInspectorModels.console.assert):
(InspectorTest.initializeInspectorModels):
* inspector-protocol/model/content-flow-content-nodes.html:
* inspector-protocol/model/content-flow-content-removal.html:
* inspector-protocol/model/content-flow-list.html:
* inspector-protocol/model/content-node-region-info.html:
* inspector-protocol/model/main-frame-resource.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162896
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-01-27 Brian Burg <bburg@apple.com>
+
+ Web Inspector: clean up initialization of managers and observers in InspectorTest
+ https://bugs.webkit.org/show_bug.cgi?id=127707
+
+ Reviewed by Timothy Hatcher.
+
+ The test harness was setting up managers and observers before
+ telling the frontend host that the page loaded. The InspectorObserver
+ was also not being initialized.
+
+ For clarity, rename importInspectorScripts to initializeInspectorModels.
+ For easier debugging, make model test assertions use InspectorTest.log.
+
+ * http/tests/inspector-protocol/resources/InspectorTest.js:
+ (InspectorTest.initializeInspectorModels.console.error.window.onerror):
+ (InspectorTest.initializeInspectorModels.console.assert):
+ (InspectorTest.initializeInspectorModels):
+ * inspector-protocol/model/content-flow-content-nodes.html:
+ * inspector-protocol/model/content-flow-content-removal.html:
+ * inspector-protocol/model/content-flow-list.html:
+ * inspector-protocol/model/content-node-region-info.html:
+ * inspector-protocol/model/main-frame-resource.html:
+
2014-01-27 David Hyatt <hyatt@apple.com>
[New Multicolumn] Add support for block progression axis and reverse direction
/*
* Copyright (C) 2012 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
window.eval(script);
}
-InspectorTest.importInspectorScripts = function()
+InspectorTest.initializeInspectorModels = function()
{
// Catch any errors and finish the test early.
console.error = window.onerror = function()
{
- console.log(Array.prototype.join.call(arguments, ', '));
+ InspectorTest.log(Array.prototype.join.call(arguments, ', '));
InspectorTest.completeTest();
};
{
if (assertion)
return;
- console.log("ASSERT:" + message);
InspectorTest.completeTest();
+ InspectorTest.log("ASSERT:" + message);
};
// Note: This function overwrites the InspectorFrontendAPI, so there's currently no
"URLUtilities",
"MessageDispatcher",
"Setting",
+ "InspectorObserver",
"PageObserver",
"DOMObserver",
"CSSObserver",
"RuntimeObserver",
"RuntimeManager"
];
+
+ // This corresponds to loading the scripts in Main.hml.
for (var i = 0; i < inspectorScripts.length; ++i)
InspectorTest.importScript("../../../../../Source/WebInspectorUI/UserInterface/" + inspectorScripts[i] + ".js");
// FIXME: As soon as we can support all the observers and managers we should remove UI related tasks
// from WebInspector.loaded, so that it can be used from the LayoutTests.
+ InspectorFrontendHost.loaded();
+
+ // Enable agents.
+ InspectorAgent.enable();
+
+ InspectorBackend.registerInspectorDispatcher(new WebInspector.InspectorObserver);
InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver);
InspectorBackend.registerDOMDispatcher(new WebInspector.DOMObserver);
InspectorBackend.registerCSSDispatcher(new WebInspector.CSSObserver);
WebInspector.domTreeManager = new WebInspector.DOMTreeManager;
WebInspector.cssStyleManager = new WebInspector.CSSStyleManager;
WebInspector.runtimeManager = new WebInspector.RuntimeManager;
-
- InspectorFrontendHost.loaded();
}
function test()
{
- InspectorTest.importInspectorScripts();
+ InspectorTest.initializeInspectorModels();
var contentFlow;
function test()
{
- InspectorTest.importInspectorScripts();
+ InspectorTest.initializeInspectorModels();
var contentFlow;
function test()
{
- InspectorTest.importInspectorScripts();
+ InspectorTest.initializeInspectorModels();
WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, function(event) {
var domTree = WebInspector.frameResourceManager.mainFrame.domTree;
var queryList = ["#flow", ".contentNode1", ".contentNode2", "body", "#region1", "#region2"];
var documentNodeId;
- InspectorTest.importInspectorScripts();
+ InspectorTest.initializeInspectorModels();
WebInspector.domTreeManager.requestDocument(function(documentNode) {
documentNodeId = documentNode.id;
WebInspector.domTreeManager.getNamedFlowCollection(documentNodeId);
<script>
function test()
{
- InspectorTest.importInspectorScripts();
+ InspectorTest.initializeInspectorModels();
WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, function(event) {
var url = WebInspector.frameResourceManager.mainFrame.url;