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

Issue 1034423003: Support clipboardData.getData() for Android

Created:
5 years, 9 months ago by ams
Modified:
5 years, 8 months ago
Reviewers:
dcheng
CC:
dcheng, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support clipboardData.getData() for Android APIs like clipboardData.getData("text/plain") was returning empty string. DataObject was relying on ReadAvailableTypes() API to get the available types before getting the actual data from the clipboard. Since it was not implemented for android, clipboard content was never added to DataObject or the DataTransfer object resulting in failure. BUG=369101

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -2 lines) Patch
M ui/base/clipboard/clipboard_android.cc View 1 chunk +6 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
ams
On 2015/03/27 15:16:23, ams wrote: > mailto:amit.srkr@samsung.com changed reviewers: > + mailto:dcheng@chromium.org PTAL
5 years, 9 months ago (2015-03-27 15:17:21 UTC) #2
dcheng
Is this covered by any tests?
5 years, 9 months ago (2015-03-27 15:38:56 UTC) #3
ams
On 2015/03/27 15:38:56, dcheng wrote: > Is this covered by any tests? Hi, Sorry for ...
5 years, 8 months ago (2015-03-31 10:23:44 UTC) #4
ams
5 years, 8 months ago (2015-04-13 07:09:48 UTC) #5
On 2015/03/31 10:23:44, ams wrote:
> On 2015/03/27 15:38:56, dcheng wrote:
> > Is this covered by any tests?
> 
> Hi,
> 
> Sorry for delayed response :-(
> There are multiple tests in layouttests/editing/pasteboard, which covers this
> aspect functionally.
> LayoutTests/editing/pasteboard/onpaste-text-html.html
> LayoutTests/editing/pasteboard/onpaste-text-html-types.html
> LayoutTests/editing/pasteboard/paste-as-plaintext-only-has-text.html
> 
> When I ran these layout tests individually on android, strangely these are
> passing. However if we run any of them manually (manual copy/paste instead of
> execCommand), they fail similar to http://jsfiddle.net/_craigmr/5n9kv as
> mentioned in the Bug.
> 
> Wondering how these tests are passing! 
> The failure is also pretty evident from below code:
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...

I found the reason for above.
The Layout-tests are only using mock_webclipboard_impl, thereby passing all the
tests.
So none of the layout-tests will be actually able to test actual clipboard in
android.

I would like to add some unittest for readAvailableTypes() though.
But I am unable to execute the clipboard test cases for android. 
I found that clipboard_android_test.cc is included under interactive_ui_tests,
which does not run for android.

@dcheng, 
could you please provide some pointer on this regard!

Powered by Google App Engine
This is Rietveld 408576698