Commit 6ce2a31f authored by yawano's avatar yawano Committed by Commit bot

Fixed memory leak of FileManagerPrivateApiTest.OnFileChanged.

Related CLs:
http://crrev.com/658013002
http://crrev.com/679383002

BUG=423257
TEST=out/Release/browser_tests --gtest_filter=FileManagerPrivateApiTest.OnFileChanged

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

Cr-Commit-Position: refs/heads/master@{#302231}
parent 592b47eb
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/file_manager/file_watcher.h" #include "chrome/browser/chromeos/file_manager/file_watcher.h"
#include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chromeos/dbus/cros_disks_client.h" #include "chromeos/dbus/cros_disks_client.h"
#include "chromeos/disks/mock_disk_mount_manager.h" #include "chromeos/disks/mock_disk_mount_manager.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
...@@ -338,7 +339,10 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, OnFileChanged) { ...@@ -338,7 +339,10 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, OnFileChanged) {
"extension_3", base::Bind(&AddFileWatchCallback)); "extension_3", base::Bind(&AddFileWatchCallback));
// event_router->addFileWatch create some tasks which are performed on message // event_router->addFileWatch create some tasks which are performed on message
// loop. Wait until they are done. // loop of BrowserThread::FILE. Wait until they are done.
content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
// We also wait the UI thread here, since some tasks which are performed above
// message loop back results to the UI thread.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
// When /a is deleted (1 and 2 is notified). // When /a is deleted (1 and 2 is notified).
...@@ -377,6 +381,6 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, OnFileChanged) { ...@@ -377,6 +381,6 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, OnFileChanged) {
"extension_3"); "extension_3");
// event_router->removeFileWatch create some tasks which are performed on // event_router->removeFileWatch create some tasks which are performed on
// message loop. wait until they are done. // message loop of BrowserThread::FILE. Wait until they are done.
base::RunLoop().RunUntilIdle(); content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
} }
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