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/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 content::RunAllPendingInMessageLoop(); | 101 content::RunAllPendingInMessageLoop(); |
102 } | 102 } |
103 | 103 |
104 private: | 104 private: |
105 std::string device_id_; | 105 std::string device_id_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPrivateApiTest); | 107 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPrivateApiTest); |
108 }; | 108 }; |
109 | 109 |
110 IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateApiTest, DeviceAttachDetachEvents) { | 110 IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateApiTest, DeviceAttachDetachEvents) { |
111 scoped_ptr<chrome::test::TestStorageMonitor> monitor( | |
112 chrome::test::TestStorageMonitor::CreateForBrowserTests()); | |
113 monitor->Init(); | |
114 monitor->MarkInitialized(); | |
115 | |
116 // Setup. | 111 // Setup. |
112 chrome::test::TestStorageMonitor::SyncInitialize(); | |
Lei Zhang
2013/07/02 23:16:57
We no longer need to put a TestStorageMonitor in g
Greg Billock
2013/07/03 17:49:17
Yes. We end up using the real one. We can sub in t
| |
117 const extensions::Extension* extension = | 113 const extensions::Extension* extension = |
118 LoadExtension(test_data_dir_.AppendASCII(kTestExtensionPath)); | 114 LoadExtension(test_data_dir_.AppendASCII(kTestExtensionPath)); |
119 ASSERT_TRUE(extension); | 115 ASSERT_TRUE(extension); |
120 | 116 |
121 content::RenderViewHost* host = | 117 content::RenderViewHost* host = |
122 extensions::ExtensionSystem::Get(browser()->profile())-> | 118 extensions::ExtensionSystem::Get(browser()->profile())-> |
123 process_manager()->GetBackgroundHostForExtension(extension->id())-> | 119 process_manager()->GetBackgroundHostForExtension(extension->id())-> |
124 render_view_host(); | 120 render_view_host(); |
125 ASSERT_TRUE(host); | 121 ASSERT_TRUE(host); |
126 | 122 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 Attach(); | 176 Attach(); |
181 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); | 177 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); |
182 Detach(); | 178 Detach(); |
183 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); | 179 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); |
184 | 180 |
185 Attach(); | 181 Attach(); |
186 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); | 182 EXPECT_TRUE(attach_finished_listener.WaitUntilSatisfied()); |
187 Detach(); | 183 Detach(); |
188 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); | 184 EXPECT_TRUE(detach_finished_listener.WaitUntilSatisfied()); |
189 } | 185 } |
OLD | NEW |