Commit 9b0d8b18 authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[DevTools] unflake TestWindowInitializedOnNavigateBack

TBR=dgozman@chromium.org

Bug: chromium:628174
Change-Id: Ibee6850f5f58296eec80097dc2c74aa1237a6c31
Reviewed-on: https://chromium-review.googlesource.com/848321
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: default avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526751}
parent f9c93846
...@@ -2027,9 +2027,8 @@ class MockWebUIProvider ...@@ -2027,9 +2027,8 @@ class MockWebUIProvider
// This tests checks that window is correctly initialized when DevTools is // This tests checks that window is correctly initialized when DevTools is
// opened while navigation through history with forward and back actions. // opened while navigation through history with forward and back actions.
// (crbug.com/627407) // (crbug.com/627407)
// Flaky on Windows and ChromeOS. http://crbug.com/628174#c4
IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, IN_PROC_BROWSER_TEST_F(DevToolsSanityTest,
DISABLED_TestWindowInitializedOnNavigateBack) { TestWindowInitializedOnNavigateBack) {
TestChromeWebUIControllerFactory test_factory; TestChromeWebUIControllerFactory test_factory;
MockWebUIProvider mock_provider("dummyurl", MockWebUIProvider mock_provider("dummyurl",
"<script>\n" "<script>\n"
......
...@@ -902,11 +902,22 @@ ...@@ -902,11 +902,22 @@
}; };
TestSuite.prototype.testWindowInitializedOnNavigateBack = function() { TestSuite.prototype.testWindowInitializedOnNavigateBack = function() {
var test = this;
test.takeControl();
var messages = ConsoleModel.consoleModel.messages(); var messages = ConsoleModel.consoleModel.messages();
this.assertEquals(1, messages.length); if (messages.length === 1) {
var text = messages[0].messageText; checkMessages();
if (text.indexOf('Uncaught') !== -1) } else {
this.fail(text); ConsoleModel.consoleModel.addEventListener(
ConsoleModel.ConsoleModel.Events.MessageAdded, checkMessages.bind(this), this);
}
function checkMessages() {
var messages = ConsoleModel.consoleModel.messages();
test.assertEquals(1, messages.length);
test.assertTrue(messages[0].messageText.indexOf('Uncaught') === -1);
test.releaseControl();
}
}; };
TestSuite.prototype.testConsoleContextNames = function() { TestSuite.prototype.testConsoleContextNames = function() {
......
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