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 "net/log/bounded_file_net_log_observer.h" | 5 #include "net/log/bounded_file_net_log_observer.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // where event size doesn't matter. | 43 // where event size doesn't matter. |
44 const size_t kDummyEventSize = 150; | 44 const size_t kDummyEventSize = 150; |
45 | 45 |
46 const std::string kWinLineEnd = "\r\n"; | 46 const std::string kWinLineEnd = "\r\n"; |
47 const std::string kLinuxLineEnd = "\n"; | 47 const std::string kLinuxLineEnd = "\n"; |
48 | 48 |
49 class BoundedFileNetLogObserverTest : public testing::Test { | 49 class BoundedFileNetLogObserverTest : public testing::Test { |
50 public: | 50 public: |
51 void SetUp() override { | 51 void SetUp() override { |
52 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 52 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
53 log_path_ = temp_dir_.path(); | 53 log_path_ = temp_dir_.GetPath(); |
54 file_thread_.reset(new base::Thread("NetLog File Thread")); | 54 file_thread_.reset(new base::Thread("NetLog File Thread")); |
55 file_thread_->StartWithOptions( | 55 file_thread_->StartWithOptions( |
56 base::Thread::Options(base::MessageLoop::TYPE_DEFAULT, 0)); | 56 base::Thread::Options(base::MessageLoop::TYPE_DEFAULT, 0)); |
57 if (file_thread_->WaitUntilThreadStarted()) { | 57 if (file_thread_->WaitUntilThreadStarted()) { |
58 logger_ = std::unique_ptr<BoundedFileNetLogObserver>( | 58 logger_ = std::unique_ptr<BoundedFileNetLogObserver>( |
59 new BoundedFileNetLogObserver(file_thread_->task_runner())); | 59 new BoundedFileNetLogObserver(file_thread_->task_runner())); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 // Concatenates all files together, including constants file and end file. | 63 // Concatenates all files together, including constants file and end file. |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 ASSERT_EQ(1u, events->GetSize()); | 854 ASSERT_EQ(1u, events->GetSize()); |
855 | 855 |
856 // Make sure additional information is present, but don't validate it. | 856 // Make sure additional information is present, but don't validate it. |
857 base::DictionaryValue* tab_info; | 857 base::DictionaryValue* tab_info; |
858 ASSERT_TRUE(dict->GetDictionary("tabInfo", &tab_info)); | 858 ASSERT_TRUE(dict->GetDictionary("tabInfo", &tab_info)); |
859 } | 859 } |
860 | 860 |
861 } // namespace | 861 } // namespace |
862 | 862 |
863 } // namespace net | 863 } // namespace net |
OLD | NEW |