OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // SystemStorage eject API browser tests. | 5 // SystemStorage eject API browser tests. |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/api/system_storage/storage_api_test_util.h" | 10 #include "chrome/browser/extensions/api/system_storage/storage_api_test_util.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 using storage_monitor::TestStorageMonitor; | 29 using storage_monitor::TestStorageMonitor; |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 class SystemStorageEjectApiTest : public ExtensionApiTest { | 33 class SystemStorageEjectApiTest : public ExtensionApiTest { |
34 public: | 34 public: |
35 SystemStorageEjectApiTest() : monitor_(NULL) {} | 35 SystemStorageEjectApiTest() : monitor_(NULL) {} |
36 virtual ~SystemStorageEjectApiTest() {} | 36 virtual ~SystemStorageEjectApiTest() {} |
37 | 37 |
38 protected: | 38 protected: |
39 virtual void SetUpOnMainThread() OVERRIDE { | 39 virtual void SetUpOnMainThread() override { |
40 monitor_ = TestStorageMonitor::CreateForBrowserTests(); | 40 monitor_ = TestStorageMonitor::CreateForBrowserTests(); |
41 ExtensionApiTest::SetUpOnMainThread(); | 41 ExtensionApiTest::SetUpOnMainThread(); |
42 } | 42 } |
43 | 43 |
44 content::RenderViewHost* GetHost() { | 44 content::RenderViewHost* GetHost() { |
45 const extensions::Extension* extension = | 45 const extensions::Extension* extension = |
46 LoadExtension(test_data_dir_.AppendASCII("system/storage_eject")); | 46 LoadExtension(test_data_dir_.AppendASCII("system/storage_eject")); |
47 return extensions::ExtensionSystem::Get(browser()->profile())-> | 47 return extensions::ExtensionSystem::Get(browser()->profile())-> |
48 process_manager()->GetBackgroundHostForExtension(extension->id())-> | 48 process_manager()->GetBackgroundHostForExtension(extension->id())-> |
49 render_view_host(); | 49 render_view_host(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 EXPECT_EQ(kRemovableStorageData.device_id, monitor_->ejected_device()); | 97 EXPECT_EQ(kRemovableStorageData.device_id, monitor_->ejected_device()); |
98 | 98 |
99 Detach(); | 99 Detach(); |
100 } | 100 } |
101 | 101 |
102 IN_PROC_BROWSER_TEST_F(SystemStorageEjectApiTest, EjectBadDeviceTest) { | 102 IN_PROC_BROWSER_TEST_F(SystemStorageEjectApiTest, EjectBadDeviceTest) { |
103 ExecuteCmdAndCheckReply(GetHost(), "ejectFailTest()", "eject_no_such_device"); | 103 ExecuteCmdAndCheckReply(GetHost(), "ejectFailTest()", "eject_no_such_device"); |
104 | 104 |
105 EXPECT_EQ("", monitor_->ejected_device()); | 105 EXPECT_EQ("", monitor_->ejected_device()); |
106 } | 106 } |
OLD | NEW |