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

Side by Side Diff: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc

Issue 11573048: [Media Galleries] Move RemovableStorageInfo notifications to chrome namespace (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/stringprintf.h" 5 #include "base/stringprintf.h"
6 #include "base/system_monitor/system_monitor.h" 6 #include "base/system_monitor/system_monitor.h"
vandebo (ex-Chrome) 2013/01/11 22:06:50 remove?
Greg Billock 2013/01/17 22:10:45 Done.
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/media_galleries_private/media_galleries_ private_api.h" 8 #include "chrome/browser/extensions/api/media_galleries_private/media_galleries_ private_api.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
11 #include "chrome/browser/extensions/extension_system.h" 11 #include "chrome/browser/extensions/extension_system.h"
12 #include "chrome/browser/extensions/extension_test_message_listener.h" 12 #include "chrome/browser/extensions/extension_test_message_listener.h"
13 #include "chrome/browser/system_monitor/media_storage_util.h" 13 #include "chrome/browser/system_monitor/media_storage_util.h"
14 #include "chrome/browser/system_monitor/removable_storage_notifications.h"
14 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
15 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/extensions/extension.h" 17 #include "chrome/common/extensions/extension.h"
17 #include "chrome/test/base/ui_test_utils.h" 18 #include "chrome/test/base/ui_test_utils.h"
18 #include "content/public/browser/render_view_host.h" 19 #include "content/public/browser/render_view_host.h"
19 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
20 #include "content/public/test/browser_test_utils.h" 21 #include "content/public/test/browser_test_utils.h"
21 #include "googleurl/src/gurl.h" 22 #include "googleurl/src/gurl.h"
22 23
23 namespace { 24 namespace {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 host->ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(js_command)); 80 host->ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(js_command));
80 EXPECT_TRUE(listener.WaitUntilSatisfied()); 81 EXPECT_TRUE(listener.WaitUntilSatisfied());
81 } 82 }
82 83
83 void AttachDetach() { 84 void AttachDetach() {
84 Attach(); 85 Attach();
85 Detach(); 86 Detach();
86 } 87 }
87 88
88 void Attach() { 89 void Attach() {
89 base::SystemMonitor::Get()->ProcessRemovableStorageAttached( 90 chrome::RemovableStorageNotifications::GetInstance()->ProcessAttach(
90 device_id_, ASCIIToUTF16(kDeviceName), kDevicePath); 91 device_id_, ASCIIToUTF16(kDeviceName), kDevicePath);
91 WaitForDeviceEvents(); 92 WaitForDeviceEvents();
92 } 93 }
93 94
94 void Detach() { 95 void Detach() {
95 base::SystemMonitor::Get()->ProcessRemovableStorageDetached(device_id_); 96 chrome::RemovableStorageNotifications::GetInstance()->ProcessDetach(
97 device_id_);
96 WaitForDeviceEvents(); 98 WaitForDeviceEvents();
97 } 99 }
98 100
99 private: 101 private:
100 void WaitForDeviceEvents() { 102 void WaitForDeviceEvents() {
101 content::RunAllPendingInMessageLoop(); 103 content::RunAllPendingInMessageLoop();
102 } 104 }
103 105
104 std::string device_id_; 106 std::string device_id_;
105 107
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 Attach(); 176 Attach();
175 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); 177 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied());
176 Detach(); 178 Detach();
177 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); 179 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied());
178 180
179 Attach(); 181 Attach();
180 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); 182 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied());
181 Detach(); 183 Detach();
182 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); 184 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied());
183 } 185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698