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

Unified Diff: ppapi/tests/test_flash_clipboard.cc

Issue 10539028: Only paste the fragment of text which was copied to the clipboard. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/clipboard/clipboard_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_flash_clipboard.cc
diff --git a/ppapi/tests/test_flash_clipboard.cc b/ppapi/tests/test_flash_clipboard.cc
index 8007d526f3305b8bde5206a2fb76479554e605fb..034a08efdec7fb29e7614823f03af27f16012beb 100644
--- a/ppapi/tests/test_flash_clipboard.cc
+++ b/ppapi/tests/test_flash_clipboard.cc
@@ -96,10 +96,15 @@ bool TestFlashClipboard::ReadHTMLMatches(const std::string& expected) {
for (int i = 0; i < kMaxIntervals; ++i) {
std::string result;
bool success = ReadStringVar(PP_FLASH_CLIPBOARD_FORMAT_HTML, &result);
- // Markup is inserted around the copied html, so just check that
- // the pasted string contains the copied string.
- if (success && result.find(expected) != std::string::npos)
+ // Harmless markup may be inserted around the copied html on some
+ // platforms, so just check that the pasted string contains the
+ // copied string. Also check that we only paste the copied fragment, see
+ // http://code.google.com/p/chromium/issues/detail?id=130827.
+ if (success && result.find(expected) != std::string::npos &&
+ result.find("<!--StartFragment-->") == std::string::npos &&
+ result.find("<!--EndFragment-->") == std::string::npos) {
return true;
+ }
PlatformSleep(kIntervalMs);
}
« no previous file with comments | « no previous file | ui/base/clipboard/clipboard_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698