Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
index 19dde92b495c6fa3627c195e282d2777d8b6a7e3..e2aa0efc97a1fa69fd39176fbdf801145fa61048 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
@@ -276,20 +276,14 @@ TEST_F('BackgroundTest', 'ShowContextMenu', function() { |
var mockFeedback = this.createMockFeedback(); |
this.runWithLoadedTree('<p>before</p><a href="a">a</a>', |
function(rootNode) { |
- mockFeedback.expectSpeech(/menu opened/) |
- .call(function() { |
- // When shown, the context menu pushes a new message loop so test |
- // messages sent to the browser do not get processed. Ensure we |
- // exit the context menu here. |
- go.showContextMenu(); |
- }); |
- mockFeedback.replay(); |
- |
var go = rootNode.find({ role: RoleType.link }); |
- this.listenOnce(go, 'focus', function(e) { |
- doCmd('contextMenu')(); |
- }.bind(this), true); |
- go.focus(); |
+ // Menus no longer nest a message loop, so we can launch menu and confirm |
+ // expected speech. The menu will not block test shutdown. |
+ mockFeedback.call(go.focus.bind(go)) |
+ .expectSpeech('a', 'Link') |
+ .call(doCmd('contextMenu')) |
+ .expectSpeech(/menu opened/); |
+ mockFeedback.replay(); |
}.bind(this)); |
}); |