Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5421)

Unified Diff: chrome/test/data/webui/plugins_browsertest.js

Issue 2563743002: Fix PluginsTest.Plugins race condition and re-enable. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/plugins_browsertest.js
diff --git a/chrome/test/data/webui/plugins_browsertest.js b/chrome/test/data/webui/plugins_browsertest.js
index 194c5f3546809fdbc1a68465b82d34dbd6a2cf07..6f613ea21067c3a9f2718e18118f8925868694fb 100644
--- a/chrome/test/data/webui/plugins_browsertest.js
+++ b/chrome/test/data/webui/plugins_browsertest.js
@@ -16,6 +16,7 @@ var ROOT_PATH = '../../../../';
*/
function PluginsTest() {
this.browserProxy = null;
+ this.setupFnResolver = new PromiseResolver();
}
PluginsTest.prototype = {
@@ -87,6 +88,8 @@ PluginsTest.prototype = {
},
};
+ this.browserProxy = new TestBrowserProxy();
+
// A function that is called from chrome://plugins to allow this test to
// replace the real Mojo browser proxy with a fake one, before any other
// code runs.
@@ -106,16 +109,17 @@ PluginsTest.prototype = {
pluginsMojom.PluginsPageHandler.name, function(handle) {
var stub = connection.bindHandleToStub(
handle, pluginsMojom.PluginsPageHandler);
- this.browserProxy = new TestBrowserProxy();
bindings.StubBindings(stub).delegate = this.browserProxy;
}.bind(this));
+ return this.setupFnResolver.promise;
}.bind(this));
}.bind(this);
},
};
-TEST_F('PluginsTest', 'DISABLED_Plugins', function() {
+TEST_F('PluginsTest', 'Plugins', function() {
var browserProxy = this.browserProxy;
+ var setupFnResolver = this.setupFnResolver;
var fakePluginData = {
name: 'Group Name',
@@ -154,6 +158,9 @@ TEST_F('PluginsTest', 'DISABLED_Plugins', function() {
var EXPECTED_PLUGINS = 2;
suiteSetup(function() {
browserProxy.setPluginsData([fakePluginData, fakePluginData]);
+ // Allow code being tested to proceed, now that fake data has been set up.
+ setupFnResolver.resolve();
+
return Promise.all([
browserProxy.whenCalled('getPluginsData'),
browserProxy.whenCalled('getShowDetails'),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698