Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Files.app: Use "ready" message instead of "worker-initialized" for wa…
Browse files Browse the repository at this point in the history
…iting initialization in SelectFileAndCancel test.

The current message "worker-initialized" does not ensure the whole initialize
process completed in Files.app, and it causes races in the test after the
refactoring of crbug.com/267281.

BUG=432029
TEST=Run SelectFileAndCancel

Review URL: https://codereview.chromium.org/714813002

Cr-Commit-Position: refs/heads/master@{#303788}
  • Loading branch information
hirono-chromium authored and Commit bot committed Nov 12, 2014
1 parent 9c7f524 commit 8866b6d
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ class SelectFileDialogExtensionBrowserTest : public ExtensionBrowserTest {
const std::string& additional_message) {
// Spawn a dialog to open a file. The dialog will signal that it is ready
// via chrome.test.sendMessage() in the extension JavaScript.
ExtensionTestMessageListener init_listener("worker-initialized",
false /* will_reply */);
ExtensionTestMessageListener init_listener("ready", false /* will_reply */);

scoped_ptr<ExtensionTestMessageListener> additional_listener;
if (!additional_message.empty()) {
Expand Down Expand Up @@ -278,8 +277,6 @@ IN_PROC_BROWSER_TEST_F(SelectFileDialogExtensionBrowserTest,
// Spawn a dialog to open a file. Provide the path to the file so the dialog
// will automatically select it. Ensure that the OK button is enabled by
// waiting for chrome.test.sendMessage('selection-change-complete').
// The extension starts a Web Worker to read file metadata, so it may send
// 'selection-change-complete' before 'worker-initialized'. This is OK.
ASSERT_NO_FATAL_FAILURE(OpenDialog(ui::SelectFileDialog::SELECT_OPEN_FILE,
test_file, owning_window,
"selection-change-complete"));
Expand All @@ -306,8 +303,6 @@ IN_PROC_BROWSER_TEST_F(SelectFileDialogExtensionBrowserTest,
// Spawn a dialog to save a file, providing a suggested path.
// Ensure "Save" button is enabled by waiting for notification from
// chrome.test.sendMessage().
// The extension starts a Web Worker to read file metadata, so it may send
// 'directory-change-complete' before 'worker-initialized'. This is OK.
ASSERT_NO_FATAL_FAILURE(OpenDialog(ui::SelectFileDialog::SELECT_SAVEAS_FILE,
test_file, owning_window,
"directory-change-complete"));
Expand Down

0 comments on commit 8866b6d

Please sign in to comment.