Commit 64e5fad6 authored by dtseng's avatar dtseng Committed by Commit bot

Revert of Add logspam to help diagnose flaky tests (patchset #2 id:20001 of...

Revert of Add logspam to help diagnose flaky tests (patchset #2 id:20001 of https://codereview.chromium.org/485843002/)

Reason for revert:
No longer needed since AutomationApiTests have been running for some time without flaking.

Original issue's description:
> Add logspam to help diagnose flaky tests
>
> BUG=391279,385701,353039,379927,384673

TBR=kalman@chromium.org,aboxhall@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=391279,385701,353039,379927,384673

Review URL: https://codereview.chromium.org/561923002

Cr-Commit-Position: refs/heads/master@{#294236}
parent 14b6864a
......@@ -133,6 +133,7 @@ void DispatchAccessibilityEventsToAutomation(
details.begin();
for (; iter != details.end(); ++iter) {
const content::AXEventNotificationDetails& event = *iter;
AXEventParams ax_event_params;
ax_event_params.process_id = event.process_id;
ax_event_params.routing_id = event.routing_id;
......@@ -148,12 +149,6 @@ void DispatchAccessibilityEventsToAutomation(
ax_tree_update.nodes.push_back(out_node);
}
DLOG(INFO) << "AccessibilityEventReceived { "
<< "process_id: " << event.process_id
<< ", routing_id:" << event.routing_id
<< ", event_type:" << ui::ToString(event.event_type)
<< "}; dispatching to JS";
// TODO(dtseng/aboxhall): Why are we sending only one update at a time? We
// should match the behavior from renderer -> browser and send a
// collection of tree updates over (to the extension); see
......
......@@ -114,7 +114,6 @@ AutomationNodeImpl.prototype = {
},
dispatchEvent: function(eventType) {
logging.LOG('dispatching ' + eventType + ' on ' + this.id);
var path = [];
var parent = this.parent();
while (parent) {
......@@ -283,8 +282,6 @@ var ATTRIBUTE_BLACKLIST = {'activedescendantId': true,
*/
function AutomationRootNodeImpl(processID, routingID) {
AutomationNodeImpl.call(this, this);
logging.LOG('AutomationRootNodeImpl constructor: processID=' + processID +
'; routingID=' + routingID + '; this.id=' + this.id);
this.processID = processID;
this.routingID = routingID;
this.axNodeDataCache_ = {};
......@@ -304,6 +301,7 @@ AutomationRootNodeImpl.prototype = {
unserialize: function(update) {
var updateState = { pendingNodes: {}, newNodes: {} };
var oldRootId = this.id;
if (update.nodeIdToClear < 0) {
logging.WARNING('Bad nodeIdToClear: ' + update.nodeIdToClear);
......@@ -498,15 +496,10 @@ AutomationRootNodeImpl.prototype = {
setData_: function(node, nodeData) {
var nodeImpl = privates(node).impl;
for (var key in AutomationAttributeDefaults) {
if (key in nodeData) {
if (key == 'id' && nodeImpl[key] != nodeData[key]) {
logging.LOG('Changing ID of node from ' + nodeImpl[key] + ' to ' +
nodeData[key]);
}
if (key in nodeData)
nodeImpl[key] = nodeData[key];
} else {
else
nodeImpl[key] = AutomationAttributeDefaults[key];
}
}
for (var i = 0; i < AutomationAttributeTypes.length; i++) {
var attributeType = AutomationAttributeTypes[i];
......
......@@ -13,7 +13,6 @@ var Event = eventBindings.Event;
var forEach = require('utils').forEach;
var lastError = require('lastError');
var schema = requireNative('automationInternal').GetSchemaAdditions();
var logging = requireNative('logging');
// TODO(aboxhall): Look into using WeakMap
var idToAutomationRootNode = {};
......@@ -34,6 +33,7 @@ var DESKTOP_TREE_ID = createAutomationRootNodeID(0, 0);
automation.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
// TODO(aboxhall, dtseng): Make this return the speced AutomationRootNode obj.
apiFunctions.setHandleRequest('getTree', function getTree(tabId, callback) {
// enableTab() ensures the renderer for the active or specified tab has
// accessibility enabled, and fetches its process and routing ids to use as
......@@ -92,8 +92,6 @@ automation.registerCustomHook(function(bindingsAPI) {
automationInternal.onAccessibilityEvent.addListener(function(data) {
var pid = data.processID;
var rid = data.routingID;
logging.LOG('onAccessibilityEvent { processID: ' + pid + ', routingID: ' +
rid + ', eventType: ' + data.eventType + ' }');
var id = createAutomationRootNodeID(pid, rid);
var targetTree = idToAutomationRootNode[id];
if (!targetTree) {
......@@ -103,7 +101,6 @@ automationInternal.onAccessibilityEvent.addListener(function(data) {
targetTree = new AutomationRootNode(pid, rid);
idToAutomationRootNode[id] = targetTree;
}
if (!privates(targetTree).impl.onAccessibilityEvent(data))
return;
......@@ -124,7 +121,7 @@ automationInternal.onAccessibilityEvent.addListener(function(data) {
// have been cached in idToCallback, so call and delete it now that we
// have the complete tree.
for (var i = 0; i < idToCallback[id].length; i++) {
logging.LOG('calling getTree() callback');
console.log('calling getTree() callback');
var callback = idToCallback[id][i];
callback(targetTree);
}
......
......@@ -24,15 +24,10 @@ function setUpAndRunTests(allTests) {
chrome.automation.getTree(function (returnedRootNode) {
rootNode = returnedRootNode;
if (rootNode.attributes.docLoaded) {
console.log('In getTree() callback: ' +
'docLoaded attr already true; running tests');
chrome.test.runTests(allTests);
return;
}
console.log('In getTree() callback: ' +
'docLoaded false; waiting for loadComplete');
rootNode.addEventListener('loadComplete', function() {
console.log('loadComplete received; running tests.');
chrome.test.runTests(allTests);
});
});
......
......@@ -17,15 +17,10 @@ function setUpAndRunTests(allTests) {
function gotTree(returnedRootNode) {
rootNode = returnedRootNode;
if (rootNode.attributes.docLoaded) {
console.log('In getTree() callback: ' +
'docLoaded attr already true; running tests');
chrome.test.runTests(allTests);
return;
}
console.log('In getTree() callback: ' +
'docLoaded false; waiting for loadComplete');
rootNode.addEventListener('loadComplete', function() {
console.log('loadComplete received; running tests.');
chrome.test.runTests(allTests);
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment