| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "mojo/edk/embedder/embedder.h" | 10 #include "mojo/edk/embedder/embedder.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 class ReportBadMessageTest : public testing::Test { | 60 class ReportBadMessageTest : public testing::Test { |
| 61 public: | 61 public: |
| 62 ReportBadMessageTest() {} | 62 ReportBadMessageTest() {} |
| 63 | 63 |
| 64 void SetUp() override { | 64 void SetUp() override { |
| 65 mojo::edk::SetDefaultProcessErrorCallback( | 65 mojo::edk::SetDefaultProcessErrorCallback( |
| 66 base::Bind(&ReportBadMessageTest::OnProcessError, | 66 base::Bind(&ReportBadMessageTest::OnProcessError, |
| 67 base::Unretained(this))); | 67 base::Unretained(this))); |
| 68 | 68 |
| 69 impl_.BindImpl(GetProxy(&proxy_)); | 69 impl_.BindImpl(MakeRequest(&proxy_)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void TearDown() override { | 72 void TearDown() override { |
| 73 mojo::edk::SetDefaultProcessErrorCallback( | 73 mojo::edk::SetDefaultProcessErrorCallback( |
| 74 mojo::edk::ProcessErrorCallback()); | 74 mojo::edk::ProcessErrorCallback()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 TestBadMessages* proxy() { return proxy_.get(); } | 77 TestBadMessages* proxy() { return proxy_.get(); } |
| 78 | 78 |
| 79 TestBadMessagesImpl* impl() { return &impl_; } | 79 TestBadMessagesImpl* impl() { return &impl_; } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 EXPECT_FALSE(error); | 187 EXPECT_FALSE(error); |
| 188 bad_message_callback.Run("nope nope nope"); | 188 bad_message_callback.Run("nope nope nope"); |
| 189 EXPECT_TRUE(error); | 189 EXPECT_TRUE(error); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace | 192 } // namespace |
| 193 } // namespace test | 193 } // namespace test |
| 194 } // namespace mojo | 194 } // namespace mojo |
| OLD | NEW |