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 "content/shell/layout_test_controller_bindings.h" | 5 #include "content/shell/webkit_test_runner_bindings.h" |
6 | 6 |
7 #include "base/string_piece.h" | 7 #include "base/string_piece.h" |
8 #include "content/public/renderer/render_view.h" | 8 #include "content/public/renderer/render_view.h" |
9 #include "content/shell/shell_messages.h" | 9 #include "content/shell/shell_messages.h" |
10 #include "grit/shell_resources.h" | 10 #include "grit/shell_resources.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
13 #include "ui/base/layout.h" | 13 #include "ui/base/layout.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 | 15 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 view->Send(new ShellViewHostMsg_NotImplemented( | 110 view->Send(new ShellViewHostMsg_NotImplemented( |
111 view->GetRoutingID(), | 111 view->GetRoutingID(), |
112 *v8::String::AsciiValue(args[0]), | 112 *v8::String::AsciiValue(args[0]), |
113 *v8::String::AsciiValue(args[1]))); | 113 *v8::String::AsciiValue(args[1]))); |
114 return v8::Undefined(); | 114 return v8::Undefined(); |
115 } | 115 } |
116 | 116 |
117 } // namespace | 117 } // namespace |
118 | 118 |
119 LayoutTestControllerBindings::LayoutTestControllerBindings() | 119 WebKitTestRunnerBindings::WebKitTestRunnerBindings() |
120 : v8::Extension("layout_test_controller.js", | 120 : v8::Extension("webkit_test_runner.js", |
121 GetStringResource( | 121 GetStringResource( |
122 IDR_CONTENT_SHELL_LAYOUT_TEST_CONTROLLER_JS).data(), | 122 IDR_CONTENT_SHELL_WEBKIT_TEST_RUNNER_JS).data(), |
123 0, // num dependencies. | 123 0, // num dependencies. |
124 NULL, // dependencies array. | 124 NULL, // dependencies array. |
125 GetStringResource( | 125 GetStringResource( |
126 IDR_CONTENT_SHELL_LAYOUT_TEST_CONTROLLER_JS).size()) { | 126 IDR_CONTENT_SHELL_WEBKIT_TEST_RUNNER_JS).size()) { |
127 } | 127 } |
128 | 128 |
129 LayoutTestControllerBindings::~LayoutTestControllerBindings() { | 129 WebKitTestRunnerBindings::~WebKitTestRunnerBindings() { |
130 } | 130 } |
131 | 131 |
132 v8::Handle<v8::FunctionTemplate> | 132 v8::Handle<v8::FunctionTemplate> |
133 LayoutTestControllerBindings::GetNativeFunction(v8::Handle<v8::String> name) { | 133 WebKitTestRunnerBindings::GetNativeFunction(v8::Handle<v8::String> name) { |
134 if (name->Equals(v8::String::New("NotifyDone"))) | 134 if (name->Equals(v8::String::New("NotifyDone"))) |
135 return v8::FunctionTemplate::New(NotifyDone); | 135 return v8::FunctionTemplate::New(NotifyDone); |
136 if (name->Equals(v8::String::New("SetDumpAsText"))) | 136 if (name->Equals(v8::String::New("SetDumpAsText"))) |
137 return v8::FunctionTemplate::New(SetDumpAsText); | 137 return v8::FunctionTemplate::New(SetDumpAsText); |
138 if (name->Equals(v8::String::New("SetDumpChildFramesAsText"))) | 138 if (name->Equals(v8::String::New("SetDumpChildFramesAsText"))) |
139 return v8::FunctionTemplate::New(SetDumpChildFramesAsText); | 139 return v8::FunctionTemplate::New(SetDumpChildFramesAsText); |
140 if (name->Equals(v8::String::New("SetPrinting"))) | 140 if (name->Equals(v8::String::New("SetPrinting"))) |
141 return v8::FunctionTemplate::New(SetPrinting); | 141 return v8::FunctionTemplate::New(SetPrinting); |
142 if (name->Equals(v8::String::New( | 142 if (name->Equals(v8::String::New( |
143 "SetShouldStayOnPageAfterHandlingBeforeUnload"))) { | 143 "SetShouldStayOnPageAfterHandlingBeforeUnload"))) { |
144 return v8::FunctionTemplate::New( | 144 return v8::FunctionTemplate::New( |
145 SetShouldStayOnPageAfterHandlingBeforeUnload); | 145 SetShouldStayOnPageAfterHandlingBeforeUnload); |
146 } | 146 } |
147 if (name->Equals(v8::String::New("SetWaitUntilDone"))) | 147 if (name->Equals(v8::String::New("SetWaitUntilDone"))) |
148 return v8::FunctionTemplate::New(SetWaitUntilDone); | 148 return v8::FunctionTemplate::New(SetWaitUntilDone); |
149 if (name->Equals(v8::String::New("NotImplemented"))) | 149 if (name->Equals(v8::String::New("NotImplemented"))) |
150 return v8::FunctionTemplate::New(NotImplemented); | 150 return v8::FunctionTemplate::New(NotImplemented); |
151 | 151 |
152 NOTREACHED(); | 152 NOTREACHED(); |
153 return v8::FunctionTemplate::New(); | 153 return v8::FunctionTemplate::New(); |
154 } | 154 } |
155 | 155 |
156 } // namespace content | 156 } // namespace content |
OLD | NEW |