| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 server_impl.set_closure(run_loop.QuitClosure()); | 327 server_impl.set_closure(run_loop.QuitClosure()); |
| 328 interface_ptr_->EchoInt( | 328 interface_ptr_->EchoInt( |
| 329 7, | 329 7, |
| 330 ValueSaver(&last_client_callback_value_seen_, base::Closure())); | 330 ValueSaver(&last_client_callback_value_seen_, base::Closure())); |
| 331 run_loop.Run(); | 331 run_loop.Run(); |
| 332 | 332 |
| 333 // Check that server saw the correct value, but the client has not yet. | 333 // Check that server saw the correct value, but the client has not yet. |
| 334 EXPECT_EQ(7, server_impl.last_server_value_seen()); | 334 EXPECT_EQ(7, server_impl.last_server_value_seen()); |
| 335 EXPECT_EQ(0, last_client_callback_value_seen_); | 335 EXPECT_EQ(0, last_client_callback_value_seen_); |
| 336 | 336 |
| 337 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) | 337 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) && !defined(OS_ANDROID) |
| 338 // Delete the callback without running it. This should cause a crash in debug | 338 // Delete the callback without running it. This should cause a crash in debug |
| 339 // builds due to a DCHECK. | 339 // builds due to a DCHECK. |
| 340 std::string regex("Check failed: !is_valid"); | 340 std::string regex("Check failed: !is_valid"); |
| 341 #if defined(OS_WIN) | 341 #if defined(OS_WIN) |
| 342 // TODO(msw): Fix MOJO_DCHECK logs and EXPECT_DEATH* on Win: crbug.com/535014 | 342 // TODO(msw): Fix MOJO_DCHECK logs and EXPECT_DEATH* on Win: crbug.com/535014 |
| 343 regex.clear(); | 343 regex.clear(); |
| 344 #endif // OS_WIN | 344 #endif // OS_WIN |
| 345 EXPECT_DEATH_IF_SUPPORTED(server_impl.DeleteCallback(), regex.c_str()); | 345 EXPECT_DEATH_IF_SUPPORTED(server_impl.DeleteCallback(), regex.c_str()); |
| 346 #endif // !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) | 346 #endif // (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) && |
| 347 // !defined(OS_ANDROID) |
| 347 } | 348 } |
| 348 | 349 |
| 349 } // namespace | 350 } // namespace |
| 350 } // namespace test | 351 } // namespace test |
| 351 } // namespace mojo | 352 } // namespace mojo |
| OLD | NEW |