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 package org.chromium.chrome.browser.contextmenu; | 5 package org.chromium.chrome.browser.contextmenu; |
6 | 6 |
7 import android.content.ClipData; | 7 import android.content.ClipData; |
8 import android.content.ClipboardManager; | 8 import android.content.ClipboardManager; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.os.Environment; | 10 import android.os.Environment; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 saveMediaFromContextMenu("testImage", R.id.contextmenu_save_image, "test
_image.png"); | 220 saveMediaFromContextMenu("testImage", R.id.contextmenu_save_image, "test
_image.png"); |
221 } | 221 } |
222 | 222 |
223 @LargeTest | 223 @LargeTest |
224 @Feature({"Browser"}) | 224 @Feature({"Browser"}) |
225 @DisableIf.Build(sdk_is_greater_than = 22, message = "crbug.com/592594") | 225 @DisableIf.Build(sdk_is_greater_than = 22, message = "crbug.com/592594") |
226 public void testSaveVideo() | 226 public void testSaveVideo() |
227 throws InterruptedException, TimeoutException, SecurityException, IO
Exception { | 227 throws InterruptedException, TimeoutException, SecurityException, IO
Exception { |
228 // Click the video to enable playback | 228 // Click the video to enable playback |
229 DOMUtils.clickNode(this, getActivity().getCurrentContentViewCore(), "vid
eoDOMElement"); | 229 DOMUtils.clickNode(this, getActivity().getCurrentContentViewCore(), "vid
eoDOMElement"); |
230 saveMediaFromContextMenu("videoDOMElement", R.id.contextmenu_save_video,
"test.mp4"); | 230 saveMediaFromContextMenu("videoDOMElement", R.id.contextmenu_save_video,
"test.webm"); |
231 } | 231 } |
232 | 232 |
233 /** | 233 /** |
234 * Opens a link and image in new tabs and verifies the order of the tabs. Al
so verifies that | 234 * Opens a link and image in new tabs and verifies the order of the tabs. Al
so verifies that |
235 * the parent page remains in front after opening links in new tabs. | 235 * the parent page remains in front after opening links in new tabs. |
236 * | 236 * |
237 * This test only applies in tabbed mode. In document mode, Android handles
the ordering of the | 237 * This test only applies in tabbed mode. In document mode, Android handles
the ordering of the |
238 * tabs. | 238 * tabs. |
239 */ | 239 */ |
240 @LargeTest | 240 @LargeTest |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 assertNotNull("Primary clip is null", clipData); | 303 assertNotNull("Primary clip is null", clipData); |
304 assertTrue("Primary clip contains no items.", clipData.getItemCount() >
0); | 304 assertTrue("Primary clip contains no items.", clipData.getItemCount() >
0); |
305 return clipData.getItemAt(0).getText().toString(); | 305 return clipData.getItemAt(0).getText().toString(); |
306 } | 306 } |
307 | 307 |
308 private void assertStringContains(String subString, String superString) { | 308 private void assertStringContains(String subString, String superString) { |
309 assertTrue("String '" + superString + "' does not contain '" + subString
+ "'", | 309 assertTrue("String '" + superString + "' does not contain '" + subString
+ "'", |
310 superString.contains(subString)); | 310 superString.contains(subString)); |
311 } | 311 } |
312 } | 312 } |
OLD | NEW |