Commit 3fa29ca5 authored by bolms@chromium.org's avatar bolms@chromium.org

ExtensionApiTest.Notifications: wait until part 1 finishes cleanup before...

ExtensionApiTest.Notifications: wait until part 1 finishes cleanup before going to part 2.  Fixes flake.

Without change: 18 failures out of 250 runs on my machine.  3 out of 250 on Linux try bot.

With change: 0 failures out of 250 runs on my machine.  0 out of 250 on Linux try bot.

TEST=Run ExtensionApiTest.Notifications many times.
BUG=42314


Review URL: http://codereview.chromium.org/7064038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86682 0039d316-1c4b-4281-b951-d872f2087c98
parent 5cd02a97
......@@ -9,8 +9,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
// Flaky, http://crbug.com/42314.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_Notifications) {
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Notifications) {
#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS)
// Notifications not supported on linux/views yet.
#else
......
......@@ -12,11 +12,13 @@ function showNotification(url) {
}
// Called by the notification when it is done with its tests.
function onNotificationDone() {
function onNotificationDone(notificationWindow) {
var views = chrome.extension.getViews();
chrome.test.assertEq(2, views.length);
notificationWindow.onunload = function() {
chrome.test.succeed();
}
notification.cancel();
chrome.test.succeed();
}
chrome.test.runTests([
......
......@@ -5,7 +5,7 @@
// permissions error.
chrome.windows.getAll(null, function() {
chrome.test.assertNoLastError();
chrome.extension.getBackgroundPage().onNotificationDone();
chrome.extension.getBackgroundPage().onNotificationDone(window);
});
</script>
Why hello there.
......
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