| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // the biggest window size, according to zlib.h | 58 // the biggest window size, according to zlib.h |
| 59 int result = inflateInit2(&stream, 16 + MAX_WBITS); | 59 int result = inflateInit2(&stream, 16 + MAX_WBITS); |
| 60 EXPECT_EQ(Z_OK, result); | 60 EXPECT_EQ(Z_OK, result); |
| 61 result = inflate(&stream, Z_FINISH); | 61 result = inflate(&stream, Z_FINISH); |
| 62 int bytes_written = kOutputBufferLength - stream.avail_out; | 62 int bytes_written = kOutputBufferLength - stream.avail_out; |
| 63 | 63 |
| 64 inflateEnd(&stream); | 64 inflateEnd(&stream); |
| 65 EXPECT_EQ(Z_STREAM_END, result); | 65 EXPECT_EQ(Z_STREAM_END, result); |
| 66 | 66 |
| 67 last_file_contents_.assign(output_str.data(), bytes_written); | 67 last_file_contents_.assign(output_str.data(), bytes_written); |
| 68 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 68 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_callback); |
| 69 base::Bind(done_callback)); | 69 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback_); |
| 70 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | |
| 71 base::Bind(callback_)); | |
| 72 } | 70 } |
| 73 | 71 |
| 74 bool TraceHasMatchingString(const char* str) { | 72 bool TraceHasMatchingString(const char* str) { |
| 75 return last_file_contents_.find(str) != std::string::npos; | 73 return last_file_contents_.find(str) != std::string::npos; |
| 76 } | 74 } |
| 77 | 75 |
| 78 int get_receive_count() const { return receive_count_; } | 76 int get_receive_count() const { return receive_count_; } |
| 79 | 77 |
| 80 const BackgroundTracingManager::ReceiveCallback& get_receive_callback() | 78 const BackgroundTracingManager::ReceiveCallback& get_receive_callback() |
| 81 const { | 79 const { |
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 EXPECT_FALSE( | 1444 EXPECT_FALSE( |
| 1447 BackgroundTracingManagerImpl::GetInstance()->IsTracingForTesting()); | 1445 BackgroundTracingManagerImpl::GetInstance()->IsTracingForTesting()); |
| 1448 | 1446 |
| 1449 run_loop.Run(); | 1447 run_loop.Run(); |
| 1450 | 1448 |
| 1451 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 1449 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
| 1452 } | 1450 } |
| 1453 } | 1451 } |
| 1454 | 1452 |
| 1455 } // namespace content | 1453 } // namespace content |
| OLD | NEW |