| OLD | NEW |
| 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/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/extensions/api/media_galleries_private/media_galleries_
private_api.h" | 7 #include "chrome/browser/extensions/api/media_galleries_private/media_galleries_
private_api.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 host->ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(js_command)); | 79 host->ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(js_command)); |
| 80 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 80 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void AttachDetach() { | 83 void AttachDetach() { |
| 84 Attach(); | 84 Attach(); |
| 85 Detach(); | 85 Detach(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void Attach() { | 88 void Attach() { |
| 89 chrome::RemovableStorageNotifications::GetInstance()->ProcessAttach( | 89 chrome::RemovableStorageNotifications::GetInstance()->receiver()-> |
| 90 device_id_, ASCIIToUTF16(kDeviceName), kDevicePath); | 90 ProcessAttach(device_id_, ASCIIToUTF16(kDeviceName), kDevicePath); |
| 91 WaitForDeviceEvents(); | 91 WaitForDeviceEvents(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void Detach() { | 94 void Detach() { |
| 95 chrome::RemovableStorageNotifications::GetInstance()->ProcessDetach( | 95 chrome::RemovableStorageNotifications::GetInstance()->receiver()-> |
| 96 device_id_); | 96 ProcessDetach(device_id_); |
| 97 WaitForDeviceEvents(); | 97 WaitForDeviceEvents(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 void WaitForDeviceEvents() { | 101 void WaitForDeviceEvents() { |
| 102 content::RunAllPendingInMessageLoop(); | 102 content::RunAllPendingInMessageLoop(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 std::string device_id_; | 105 std::string device_id_; |
| 106 | 106 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 Attach(); | 175 Attach(); |
| 176 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); | 176 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); |
| 177 Detach(); | 177 Detach(); |
| 178 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); | 178 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); |
| 179 | 179 |
| 180 Attach(); | 180 Attach(); |
| 181 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); | 181 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); |
| 182 Detach(); | 182 Detach(); |
| 183 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); | 183 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); |
| 184 } | 184 } |
| OLD | NEW |