| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_split.h" | 7 #include "base/string_split.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 render_view_host); | 76 render_view_host); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void PageCyclerDidFinishLoad(int64 frame_id, | 79 void PageCyclerDidFinishLoad(int64 frame_id, |
| 80 const GURL& validated_url, | 80 const GURL& validated_url, |
| 81 bool is_main_frame) { | 81 bool is_main_frame) { |
| 82 PageCycler::DidFinishLoad(frame_id, validated_url, is_main_frame); | 82 PageCycler::DidFinishLoad(frame_id, validated_url, is_main_frame); |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 | |
| 87 // We need to override Finish() because the calls to exit the browser in a | 86 // We need to override Finish() because the calls to exit the browser in a |
| 88 // real PageCycler do not work in unittests (they interfere with later tests). | 87 // real PageCycler do not work in unittests (they interfere with later tests). |
| 89 virtual void Finish() OVERRIDE { | 88 virtual void Finish() OVERRIDE { |
| 90 BrowserList::RemoveObserver(this); | 89 BrowserList::RemoveObserver(this); |
| 91 Release(); | 90 Release(); |
| 92 } | 91 } |
| 93 | 92 |
| 94 virtual ~MockPageCycler() {}\ | 93 virtual ~MockPageCycler() {}\ |
| 95 | 94 |
| 96 DISALLOW_COPY_AND_ASSIGN(MockPageCycler); | 95 DISALLOW_COPY_AND_ASSIGN(MockPageCycler); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 .WillRepeatedly(Invoke(page_cycler(), | 338 .WillRepeatedly(Invoke(page_cycler(), |
| 340 &MockPageCycler::PageCyclerDidFinishLoad)); | 339 &MockPageCycler::PageCyclerDidFinishLoad)); |
| 341 | 340 |
| 342 for (int i = 0; i < kNumLoads; ++i) | 341 for (int i = 0; i < kNumLoads; ++i) |
| 343 FinishLoad(); | 342 FinishLoad(); |
| 344 | 343 |
| 345 PumpLoop(); | 344 PumpLoop(); |
| 346 EXPECT_FALSE(PathExists(errors_file())); | 345 EXPECT_FALSE(PathExists(errors_file())); |
| 347 ASSERT_TRUE(PathExists(stats_file())); | 346 ASSERT_TRUE(PathExists(stats_file())); |
| 348 } | 347 } |
| OLD | NEW |