| 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/numerics/safe_math.h" | 9 #include "base/numerics/safe_math.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 std::unique_ptr<base::Value> output; | 272 std::unique_ptr<base::Value> output; |
| 273 | 273 |
| 274 ASSERT_TRUE(ptr->BounceValue(nullptr, &output)); | 274 ASSERT_TRUE(ptr->BounceValue(nullptr, &output)); |
| 275 EXPECT_FALSE(output); | 275 EXPECT_FALSE(output); |
| 276 | 276 |
| 277 std::unique_ptr<base::Value> input = base::Value::CreateNullValue(); | 277 std::unique_ptr<base::Value> input = base::Value::CreateNullValue(); |
| 278 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); | 278 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); |
| 279 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); | 279 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); |
| 280 | 280 |
| 281 input = base::MakeUnique<base::FundamentalValue>(123); | 281 input = base::MakeUnique<base::Value>(123); |
| 282 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); | 282 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); |
| 283 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); | 283 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); |
| 284 | 284 |
| 285 input = base::MakeUnique<base::FundamentalValue>(1.23); | 285 input = base::MakeUnique<base::Value>(1.23); |
| 286 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); | 286 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); |
| 287 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); | 287 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); |
| 288 | 288 |
| 289 input = base::MakeUnique<base::FundamentalValue>(false); | 289 input = base::MakeUnique<base::Value>(false); |
| 290 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); | 290 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); |
| 291 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); | 291 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); |
| 292 | 292 |
| 293 input = base::MakeUnique<base::StringValue>("test string"); | 293 input = base::MakeUnique<base::StringValue>("test string"); |
| 294 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); | 294 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); |
| 295 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); | 295 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); |
| 296 | 296 |
| 297 input = base::BinaryValue::CreateWithCopiedBuffer("mojo", 4); | 297 input = base::BinaryValue::CreateWithCopiedBuffer("mojo", 4); |
| 298 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); | 298 ASSERT_TRUE(ptr->BounceValue(input->CreateDeepCopy(), &output)); |
| 299 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); | 299 EXPECT_TRUE(base::Value::Equals(input.get(), output.get())); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 for (size_t i = 0; i < arraysize(kTestDirections); i++) { | 424 for (size_t i = 0; i < arraysize(kTestDirections); i++) { |
| 425 base::i18n::TextDirection direction_out; | 425 base::i18n::TextDirection direction_out; |
| 426 ASSERT_TRUE(ptr->BounceTextDirection(kTestDirections[i], &direction_out)); | 426 ASSERT_TRUE(ptr->BounceTextDirection(kTestDirections[i], &direction_out)); |
| 427 EXPECT_EQ(kTestDirections[i], direction_out); | 427 EXPECT_EQ(kTestDirections[i], direction_out); |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace test | 431 } // namespace test |
| 432 } // namespace common | 432 } // namespace common |
| 433 } // namespace mojo | 433 } // namespace mojo |
| OLD | NEW |