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

Unified Diff: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc

Issue 17504004: Add test storage monitor for MediaGalleries Private API browser test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc
diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc
index 197a01e6ffe49030533f9553736bf0c5f0f29b9e..c85d58aefec396753375466396154ef6b893720e 100644
--- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc
+++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
+#include "chrome/browser/storage_monitor/test_storage_monitor.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
@@ -86,37 +87,32 @@ class MediaGalleriesPrivateApiTest : public ExtensionApiTest {
}
void Attach() {
+ DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized());
chrome::StorageInfo info(device_id_, ASCIIToUTF16(kDeviceName), kDevicePath,
string16(), string16(), string16(), 0);
chrome::StorageMonitor::GetInstance()->receiver()->ProcessAttach(info);
- WaitForDeviceEvents();
+ content::RunAllPendingInMessageLoop();
}
void Detach() {
+ DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized());
chrome::StorageMonitor::GetInstance()->receiver()->ProcessDetach(
device_id_);
- WaitForDeviceEvents();
- }
-
- private:
- void WaitForDeviceEvents() {
content::RunAllPendingInMessageLoop();
}
+ private:
std::string device_id_;
DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPrivateApiTest);
};
-// TODO(jschuh): Flaky on Win64 & Linux Aura build. crbug.com/247336
-#if (defined(OS_WIN) && defined(ARCH_CPU_X86_64)) || \
- (defined(OS_LINUX) && defined(USE_AURA))
-#define MAYBE_DeviceAttachDetachEvents DISABLED_DeviceAttachDetachEvents
-#else
-#define MAYBE_DeviceAttachDetachEvents DeviceAttachDetachEvents
-#endif
-IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateApiTest,
- MAYBE_DeviceAttachDetachEvents) {
+IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateApiTest, DeviceAttachDetachEvents) {
+ scoped_ptr<chrome::test::TestStorageMonitor> monitor(
+ chrome::test::TestStorageMonitor::CreateForBrowserTests());
+ monitor->Init();
+ monitor->MarkInitialized();
+
// Setup.
const extensions::Extension* extension =
LoadExtension(test_data_dir_.AppendASCII(kTestExtensionPath));
« 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