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

Side by Side Diff: webkit/tools/test_shell/layout_test_controller.h

Issue 8215002: base::Bind: Cleanup in test_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. Created 9 years, 2 months 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 /* 5 /*
6 LayoutTestController class: 6 LayoutTestController class:
7 Bound to a JavaScript window.layoutTestController object using the 7 Bound to a JavaScript window.layoutTestController object using the
8 CppBoundClass::BindToJavascript(), this allows layout tests that are run in 8 CppBoundClass::BindToJavascript(), this allows layout tests that are run in
9 the test_shell (or, in principle, any web page loaded into a client app built 9 the test_shell (or, in principle, any web page loaded into a client app built
10 with this class) to control various aspects of how the tests are run and what 10 with this class) to control various aspects of how the tests are run and what
11 sort of output they produce. 11 sort of output they produce.
12 */ 12 */
13 13
14 #ifndef WEBKIT_TOOLS_TEST_SHELL_LAYOUT_TEST_CONTROLLER_H_ 14 #ifndef WEBKIT_TOOLS_TEST_SHELL_LAYOUT_TEST_CONTROLLER_H_
15 #define WEBKIT_TOOLS_TEST_SHELL_LAYOUT_TEST_CONTROLLER_H_ 15 #define WEBKIT_TOOLS_TEST_SHELL_LAYOUT_TEST_CONTROLLER_H_
16 16
17 #include <queue> 17 #include <queue>
18 18
19 #include "base/memory/weak_ptr.h"
19 #include "base/timer.h" 20 #include "base/timer.h"
20 #include "base/string16.h" 21 #include "base/string16.h"
21 #include "webkit/glue/cpp_bound_class.h" 22 #include "webkit/glue/cpp_bound_class.h"
22 23
23 class TestShell; 24 class TestShell;
24 25
25 class LayoutTestController : public CppBoundClass { 26 class LayoutTestController : public CppBoundClass {
26 public: 27 public:
27 // Builds the property and method lists needed to bind this class to a JS 28 // Builds the property and method lists needed to bind this class to a JS
28 // object. 29 // object.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 }; 102 };
102 103
103 void notifyDoneTimedOut(); 104 void notifyDoneTimedOut();
104 105
105 void LogErrorToConsole(const std::string& text); 106 void LogErrorToConsole(const std::string& text);
106 107
107 void completeNotifyDone(bool is_timeout); 108 void completeNotifyDone(bool is_timeout);
108 109
109 // Used for test timeouts. 110 // Used for test timeouts.
110 // TODO(ojan): Use base::OneShotTimer. 111 // TODO(ojan): Use base::OneShotTimer.
111 ScopedRunnableMethodFactory<LayoutTestController> timeout_factory_; 112 base::WeakPtrFactory<LayoutTestController> weak_factory_;
112 113
113 // Non-owning pointer. The LayoutTestController is owned by the host. 114 // Non-owning pointer. The LayoutTestController is owned by the host.
114 static TestShell* shell_; 115 static TestShell* shell_;
115 116
116 // If true, the element will be treated as editable. This value is returned 117 // If true, the element will be treated as editable. This value is returned
117 // from various editing callbacks that are called just before edit operations 118 // from various editing callbacks that are called just before edit operations
118 // are allowed. 119 // are allowed.
119 static bool accepts_editing_; 120 static bool accepts_editing_;
120 121
121 // If true, new windows can be opened via javascript or by plugins. By 122 // If true, new windows can be opened via javascript or by plugins. By
(...skipping 10 matching lines...) Expand all
132 // DidStartProvisionalLoadForFrame callback. 133 // DidStartProvisionalLoadForFrame callback.
133 static bool stop_provisional_frame_loads_; 134 static bool stop_provisional_frame_loads_;
134 135
135 // If true, don't dump output until notifyDone is called. 136 // If true, don't dump output until notifyDone is called.
136 static bool wait_until_done_; 137 static bool wait_until_done_;
137 138
138 static WorkQueue work_queue_; 139 static WorkQueue work_queue_;
139 }; 140 };
140 141
141 #endif // WEBKIT_TOOLS_TEST_SHELL_LAYOUT_TEST_CONTROLLER_H_ 142 #endif // WEBKIT_TOOLS_TEST_SHELL_LAYOUT_TEST_CONTROLLER_H_
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_host_unittest.cc ('k') | webkit/tools/test_shell/layout_test_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698