Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: content/renderer/scheduler/task_queue_manager_unittest.cc

Issue 681793003: scheduler: Add support for tracing scheduler state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/scheduler/task_queue_manager.h" 5 #include "content/renderer/scheduler/task_queue_manager.h"
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "content/renderer/scheduler/task_queue_selector.h" 9 #include "content/renderer/scheduler/task_queue_selector.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 void AppendQueueToService(size_t queue_index) { 32 void AppendQueueToService(size_t queue_index) {
33 queues_to_service_.push_back(queue_index); 33 queues_to_service_.push_back(queue_index);
34 } 34 }
35 35
36 const std::vector<const base::TaskQueue*>& work_queues() { 36 const std::vector<const base::TaskQueue*>& work_queues() {
37 return work_queues_; 37 return work_queues_;
38 } 38 }
39 39
40 void AsValueInto(base::debug::TracedValue* state) const override {
41 }
42
40 private: 43 private:
41 std::deque<size_t> queues_to_service_; 44 std::deque<size_t> queues_to_service_;
42 std::vector<const base::TaskQueue*> work_queues_; 45 std::vector<const base::TaskQueue*> work_queues_;
43 46
44 DISALLOW_COPY_AND_ASSIGN(SelectorForTest); 47 DISALLOW_COPY_AND_ASSIGN(SelectorForTest);
45 }; 48 };
46 49
47 class TaskQueueManagerTest : public testing::Test { 50 class TaskQueueManagerTest : public testing::Test {
48 protected: 51 protected:
49 void Initialize(size_t num_queues) { 52 void Initialize(size_t num_queues) {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 FROM_HERE, base::Bind(&PostTaskToRunner, runner, &run_order)); 352 FROM_HERE, base::Bind(&PostTaskToRunner, runner, &run_order));
350 thread.Stop(); 353 thread.Stop();
351 354
352 selector_->AppendQueueToService(0); 355 selector_->AppendQueueToService(0);
353 message_loop.RunUntilIdle(); 356 message_loop.RunUntilIdle();
354 EXPECT_EQ(1, run_order[0]); 357 EXPECT_EQ(1, run_order[0]);
355 } 358 }
356 359
357 } // namespace 360 } // namespace
358 } // namespace content 361 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/scheduler/task_queue_manager.cc ('k') | content/renderer/scheduler/task_queue_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698