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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.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" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "mojo/data_pipe_utils/data_pipe_utils.h" | 12 #include "mojo/data_pipe_utils/data_pipe_utils.h" |
13 #include "mojo/message_pump/message_pump_mojo.h" | 13 #include "mojo/message_pump/message_pump_mojo.h" |
14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
15 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | 15 #include "mojo/services/network/interfaces/network_service.mojom.h" |
16 #include "shell/crash/crash_upload.h" | 16 #include "shell/crash/crash_upload.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace breakpad { | 19 namespace breakpad { |
20 namespace { | 20 namespace { |
21 | 21 |
22 class MockURLLoader : public mojo::URLLoader { | 22 class MockURLLoader : public mojo::URLLoader { |
23 public: | 23 public: |
24 MockURLLoader() : called_(false) {} | 24 MockURLLoader() : called_(false) {} |
25 ~MockURLLoader() override {} | 25 ~MockURLLoader() override {} |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 EXPECT_TRUE(mock_network_service_.url_loader()->called()); | 202 EXPECT_TRUE(mock_network_service_.url_loader()->called()); |
203 EXPECT_TRUE(base::PathExists(GetSentinelPath(dumps_dir_.path()))); | 203 EXPECT_TRUE(base::PathExists(GetSentinelPath(dumps_dir_.path()))); |
204 EXPECT_EQ(GetDumpContent(dumps_dir_.path().Append("0.dmp")), | 204 EXPECT_EQ(GetDumpContent(dumps_dir_.path().Append("0.dmp")), |
205 mock_network_service_.url_loader()->GetLastContent()); | 205 mock_network_service_.url_loader()->GetLastContent()); |
206 EXPECT_EQ(1, CountFiles(dumps_dir_.path())); | 206 EXPECT_EQ(1, CountFiles(dumps_dir_.path())); |
207 } | 207 } |
208 | 208 |
209 } // namespace | 209 } // namespace |
210 } // namespace breakpad | 210 } // namespace breakpad |
OLD | NEW |