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

Side by Side Diff: chrome/browser/metrics/thread_watcher_unittest.cc

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <math.h> 5 #include <math.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "base/string_tokenizer.h" 13 #include "base/string_tokenizer.h"
14 #include "base/synchronization/condition_variable.h" 14 #include "base/synchronization/condition_variable.h"
15 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
16 #include "base/threading/platform_thread.h" 16 #include "base/threading/platform_thread.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "build/build_config.h" 18 #include "build/build_config.h"
19 #include "chrome/browser/metrics/thread_watcher.h" 19 #include "chrome/browser/metrics/thread_watcher.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "content/test/test_browser_thread.h" 21 #include "content/test/test_browser_thread.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 #include "testing/platform_test.h" 23 #include "testing/platform_test.h"
24 24
25 using base::TimeDelta; 25 using base::TimeDelta;
26 using base::TimeTicks; 26 using base::TimeTicks;
27 using content::BrowserThread;
27 28
28 enum State { 29 enum State {
29 INITIALIZED, // Created ThreadWatch object. 30 INITIALIZED, // Created ThreadWatch object.
30 ACTIVATED, // Thread watching activated. 31 ACTIVATED, // Thread watching activated.
31 SENT_PING, // Sent ping message to watched thread. 32 SENT_PING, // Sent ping message to watched thread.
32 RECEIVED_PONG, // Received Pong message. 33 RECEIVED_PONG, // Received Pong message.
33 DEACTIVATED, // Thread watching de-activated. 34 DEACTIVATED, // Thread watching de-activated.
34 }; 35 };
35 36
36 enum WaitState { 37 enum WaitState {
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 base::Bind(&ThreadWatcher::DeActivateThreadWatching, 553 base::Bind(&ThreadWatcher::DeActivateThreadWatching,
553 base::Unretained(io_watcher_))); 554 base::Unretained(io_watcher_)));
554 WatchDogThread::PostTask( 555 WatchDogThread::PostTask(
555 FROM_HERE, 556 FROM_HERE,
556 base::Bind(&ThreadWatcher::DeActivateThreadWatching, 557 base::Bind(&ThreadWatcher::DeActivateThreadWatching,
557 base::Unretained(webkit_watcher_))); 558 base::Unretained(webkit_watcher_)));
558 559
559 // Wait for the io_watcher_'s VeryLongMethod to finish. 560 // Wait for the io_watcher_'s VeryLongMethod to finish.
560 io_watcher_->WaitForWaitStateChange(kUnresponsiveTime * 10, ALL_DONE); 561 io_watcher_->WaitForWaitStateChange(kUnresponsiveTime * 10, ALL_DONE);
561 } 562 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/thread_watcher.cc ('k') | chrome/browser/mock_browsing_data_quota_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698