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