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

Unified Diff: third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp

Issue 2823163002: Port some AOM tests from LayoutTests to SimTests. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp b/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
index 5af3fcb30da5b45490114eaa77c0df89c33db5fd..ced38afacd1f18a76e8890eee8115594935f4fa9 100644
--- a/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
@@ -8,42 +8,14 @@
#include "public/platform/Platform.h"
#include "public/platform/WebViewScheduler.h"
#include "public/web/WebLocalFrame.h"
-#include "public/web/WebScriptExecutionCallback.h"
-#include "public/web/WebScriptSource.h"
#include "public/web/WebView.h"
#include "web/tests/sim/SimRequest.h"
#include "web/tests/sim/SimTest.h"
namespace blink {
-namespace {
-class ScriptExecutionCallbackHelper : public WebScriptExecutionCallback {
- public:
- const String Result() const { return result_; }
-
- private:
- void Completed(const WebVector<v8::Local<v8::Value>>& values) override {
- if (!values.IsEmpty() && !values[0].IsEmpty() && values[0]->IsString()) {
- result_ = ToCoreString(v8::Local<v8::String>::Cast(values[0]));
- }
- }
-
- String result_;
-};
-} // namespace
-
class VirtualTimeTest : public SimTest {
protected:
- String ExecuteJavaScript(String script_source) {
- ScriptExecutionCallbackHelper callback_helper;
- WebView()
- .MainFrame()
- ->ToWebLocalFrame()
- ->RequestExecuteScriptAndReturnValue(
- WebScriptSource(WebString(script_source)), false, &callback_helper);
- return callback_helper.Result();
- }
-
void TearDown() override {
// The SimTest destructor calls runPendingTasks. This is a problem because
// if there are any repeating tasks, advancing virtual time will cause the

Powered by Google App Engine
This is Rietveld 408576698