| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/aura/mus/os_exchange_data_provider_mus.h" | 5 #include "ui/aura/mus/os_exchange_data_provider_mus.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 base::Pickle restored_pickle; | 183 base::Pickle restored_pickle; |
| 184 EXPECT_TRUE(copy.GetPickledData(kTestFormat, &restored_pickle)); | 184 EXPECT_TRUE(copy.GetPickledData(kTestFormat, &restored_pickle)); |
| 185 base::PickleIterator iterator(restored_pickle); | 185 base::PickleIterator iterator(restored_pickle); |
| 186 int value; | 186 int value; |
| 187 EXPECT_TRUE(iterator.ReadInt(&value)); | 187 EXPECT_TRUE(iterator.ReadInt(&value)); |
| 188 EXPECT_EQ(1, value); | 188 EXPECT_EQ(1, value); |
| 189 EXPECT_TRUE(iterator.ReadInt(&value)); | 189 EXPECT_TRUE(iterator.ReadInt(&value)); |
| 190 EXPECT_EQ(2, value); | 190 EXPECT_EQ(2, value); |
| 191 } | 191 } |
| 192 | 192 |
| 193 #if defined(USE_AURA) | |
| 194 TEST_F(OSExchangeDataProviderMusTest, TestHTML) { | 193 TEST_F(OSExchangeDataProviderMusTest, TestHTML) { |
| 195 OSExchangeData data; | 194 OSExchangeData data; |
| 196 GURL url("http://www.google.com/"); | 195 GURL url("http://www.google.com/"); |
| 197 base::string16 html = base::ASCIIToUTF16( | 196 base::string16 html = base::ASCIIToUTF16( |
| 198 "<HTML>\n<BODY>\n" | 197 "<HTML>\n<BODY>\n" |
| 199 "<b>bold.</b> <i><b>This is bold italic.</b></i>\n" | 198 "<b>bold.</b> <i><b>This is bold italic.</b></i>\n" |
| 200 "</BODY>\n</HTML>"); | 199 "</BODY>\n</HTML>"); |
| 201 data.SetHtml(html, url); | 200 data.SetHtml(html, url); |
| 202 | 201 |
| 203 OSExchangeData copy( | 202 OSExchangeData copy( |
| 204 std::unique_ptr<OSExchangeData::Provider>(data.provider().Clone())); | 203 std::unique_ptr<OSExchangeData::Provider>(data.provider().Clone())); |
| 205 base::string16 read_html; | 204 base::string16 read_html; |
| 206 EXPECT_TRUE(copy.GetHtml(&read_html, &url)); | 205 EXPECT_TRUE(copy.GetHtml(&read_html, &url)); |
| 207 EXPECT_EQ(html, read_html); | 206 EXPECT_EQ(html, read_html); |
| 208 } | 207 } |
| 209 #endif | |
| 210 | 208 |
| 211 } // namespace aura | 209 } // namespace aura |
| OLD | NEW |