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

Side by Side Diff: extensions/browser/api/system_storage/system_storage_eject_apitest.cc

Issue 1257603003: Revert of Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « content/renderer/render_view_browsertest_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/storage_monitor/storage_info.h" 10 #include "components/storage_monitor/storage_info.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 return extensions::ProcessManager::Get(browser_context()) 52 return extensions::ProcessManager::Get(browser_context())
53 ->GetBackgroundHostForExtension(extension->id()) 53 ->GetBackgroundHostForExtension(extension->id())
54 ->render_view_host(); 54 ->render_view_host();
55 } 55 }
56 56
57 void ExecuteCmdAndCheckReply(content::RenderViewHost* host, 57 void ExecuteCmdAndCheckReply(content::RenderViewHost* host,
58 const std::string& js_command, 58 const std::string& js_command,
59 const std::string& ok_message) { 59 const std::string& ok_message) {
60 ExtensionTestMessageListener listener(ok_message, false); 60 ExtensionTestMessageListener listener(ok_message, false);
61 host->GetMainFrame()->ExecuteJavaScriptForTests( 61 host->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16(js_command));
62 base::ASCIIToUTF16(js_command));
63 EXPECT_TRUE(listener.WaitUntilSatisfied()); 62 EXPECT_TRUE(listener.WaitUntilSatisfied());
64 } 63 }
65 64
66 void Attach() { 65 void Attach() {
67 DCHECK(StorageMonitor::GetInstance()->IsInitialized()); 66 DCHECK(StorageMonitor::GetInstance()->IsInitialized());
68 StorageMonitor::GetInstance()->receiver()->ProcessAttach( 67 StorageMonitor::GetInstance()->receiver()->ProcessAttach(
69 extensions::test::BuildStorageInfoFromTestStorageUnitInfo( 68 extensions::test::BuildStorageInfoFromTestStorageUnitInfo(
70 kRemovableStorageData)); 69 kRemovableStorageData));
71 content::RunAllPendingInMessageLoop(); 70 content::RunAllPendingInMessageLoop();
72 } 71 }
(...skipping 28 matching lines...) Expand all
101 EXPECT_EQ(kRemovableStorageData.device_id, monitor_->ejected_device()); 100 EXPECT_EQ(kRemovableStorageData.device_id, monitor_->ejected_device());
102 101
103 Detach(); 102 Detach();
104 } 103 }
105 104
106 IN_PROC_BROWSER_TEST_F(SystemStorageEjectApiTest, EjectBadDeviceTest) { 105 IN_PROC_BROWSER_TEST_F(SystemStorageEjectApiTest, EjectBadDeviceTest) {
107 ExecuteCmdAndCheckReply(GetHost(), "ejectFailTest()", "eject_no_such_device"); 106 ExecuteCmdAndCheckReply(GetHost(), "ejectFailTest()", "eject_no_such_device");
108 107
109 EXPECT_EQ("", monitor_->ejected_device()); 108 EXPECT_EQ("", monitor_->ejected_device());
110 } 109 }
OLDNEW
« no previous file with comments | « content/renderer/render_view_browsertest_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698