OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 Clipboard::BUFFER_STANDARD)); | 135 Clipboard::BUFFER_STANDARD)); |
136 clipboard.ReadHTML(Clipboard::BUFFER_STANDARD, &markup_result, &url_result); | 136 clipboard.ReadHTML(Clipboard::BUFFER_STANDARD, &markup_result, &url_result); |
137 EXPECT_TRUE(ClipboardContentsIsExpected(markup, markup_result)); | 137 EXPECT_TRUE(ClipboardContentsIsExpected(markup, markup_result)); |
138 #if defined(OS_WIN) | 138 #if defined(OS_WIN) |
139 // TODO(playmobil): It's not clear that non windows clipboards need to support | 139 // TODO(playmobil): It's not clear that non windows clipboards need to support |
140 // this. | 140 // this. |
141 EXPECT_EQ(url, url_result); | 141 EXPECT_EQ(url, url_result); |
142 #endif // defined(OS_WIN) | 142 #endif // defined(OS_WIN) |
143 } | 143 } |
144 | 144 |
145 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 145 #if defined(TOOLKIT_USES_GTK) |
146 // Regression test for crbug.com/56298 (pasting empty HTML crashes Linux). | 146 // Regression test for crbug.com/56298 (pasting empty HTML crashes Linux). |
147 TEST_F(ClipboardTest, EmptyHTMLTest) { | 147 TEST_F(ClipboardTest, EmptyHTMLTest) { |
148 Clipboard clipboard; | 148 Clipboard clipboard; |
149 // ScopedClipboardWriter doesn't let us write empty data to the clipboard. | 149 // ScopedClipboardWriter doesn't let us write empty data to the clipboard. |
150 clipboard.clipboard_data_ = new Clipboard::TargetMap(); | 150 clipboard.clipboard_data_ = new Clipboard::TargetMap(); |
151 // The 1 is so the compiler doesn't warn about allocating an empty array. | 151 // The 1 is so the compiler doesn't warn about allocating an empty array. |
152 char* empty = new char[1]; | 152 char* empty = new char[1]; |
153 clipboard.InsertMapping("text/html", empty, 0U); | 153 clipboard.InsertMapping("text/html", empty, 0U); |
154 clipboard.SetGtkClipboard(); | 154 clipboard.SetGtkClipboard(); |
155 | 155 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 writer.WriteBookmark(UTF8ToUTF16("foo"), "bar"); | 423 writer.WriteBookmark(UTF8ToUTF16("foo"), "bar"); |
424 writer.WriteHyperlink(ASCIIToUTF16("foo"), "bar"); | 424 writer.WriteHyperlink(ASCIIToUTF16("foo"), "bar"); |
425 writer.WriteWebSmartPaste(); | 425 writer.WriteWebSmartPaste(); |
426 // Left out: WriteFile, WriteFiles, WriteBitmapFromPixels, WritePickledData. | 426 // Left out: WriteFile, WriteFiles, WriteBitmapFromPixels, WritePickledData. |
427 } | 427 } |
428 | 428 |
429 // Passes if we don't crash. | 429 // Passes if we don't crash. |
430 } | 430 } |
431 | 431 |
432 } // namespace ui | 432 } // namespace ui |
OLD | NEW |