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

Unified Diff: content/test/layout_tests/runner/GamepadController.h

Issue 110533009: Import TestRunner library into chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years 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: content/test/layout_tests/runner/GamepadController.h
diff --git a/third_party/tcmalloc/vendor/src/base/thread_lister.c b/content/test/layout_tests/runner/GamepadController.h
similarity index 52%
copy from third_party/tcmalloc/vendor/src/base/thread_lister.c
copy to content/test/layout_tests/runner/GamepadController.h
index bc180dba7a9f2ba3b8261009c8af85f0b1d4a023..c28112902fcb5ea4eb05025793ff10687fc886e3 100644
--- a/third_party/tcmalloc/vendor/src/base/thread_lister.c
+++ b/content/test/layout_tests/runner/GamepadController.h
@@ -1,5 +1,9 @@
-/* Copyright (c) 2005-2007, Google Inc.
- * All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,52 +30,47 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ---
- * Author: Markus Gutschke
*/
-#include "config.h"
-#include <stdio.h> /* needed for NULL on some powerpc platforms (?!) */
-#ifdef HAVE_SYS_PRCTL
-# include <sys/prctl.h>
-#endif
-#include "base/thread_lister.h"
-#include "base/linuxthreads.h"
-/* Include other thread listers here that define THREADS macro
- * only when they can provide a good implementation.
- */
+#ifndef GamepadController_h
+#define GamepadController_h
-#ifndef THREADS
+#include "content/test/layout_tests/runner/CppBoundClass.h"
+#include "third_party/WebKit/public/platform/WebGamepads.h"
-/* Default trivial thread lister for single-threaded applications,
- * or if the multi-threading code has not been ported, yet.
- */
+namespace blink {
+class WebGamepads;
+class WebFrame;
+}
-int ListAllProcessThreads(void *parameter,
- ListAllProcessThreadsCallBack callback, ...) {
- int rc;
- va_list ap;
- pid_t pid;
+namespace WebTestRunner {
-#ifdef HAVE_SYS_PRCTL
- int dumpable = prctl(PR_GET_DUMPABLE, 0);
- if (!dumpable)
- prctl(PR_SET_DUMPABLE, 1);
-#endif
- va_start(ap, callback);
- pid = getpid();
- rc = callback(parameter, 1, &pid, ap);
- va_end(ap);
-#ifdef HAVE_SYS_PRCTL
- if (!dumpable)
- prctl(PR_SET_DUMPABLE, 0);
-#endif
- return rc;
-}
+class WebTestDelegate;
+
+class GamepadController : public CppBoundClass {
+public:
+ GamepadController();
+
+ void bindToJavascript(blink::WebFrame*, const blink::WebString& classname);
+ void setDelegate(WebTestDelegate*);
+ void reset();
+
+private:
+ // Bound methods and properties
+ void connect(const CppArgumentList&, CppVariant*);
+ void disconnect(const CppArgumentList&, CppVariant*);
+ void setId(const CppArgumentList&, CppVariant*);
+ void setButtonCount(const CppArgumentList&, CppVariant*);
+ void setButtonData(const CppArgumentList&, CppVariant*);
+ void setAxisCount(const CppArgumentList&, CppVariant*);
+ void setAxisData(const CppArgumentList&, CppVariant*);
+ void fallbackCallback(const CppArgumentList&, CppVariant*);
+
+ blink::WebGamepads m_gamepads;
+
+ WebTestDelegate* m_delegate;
+};
-int ResumeAllProcessThreads(int num_threads, pid_t *thread_pids) {
- return 1;
}
-#endif /* ifndef THREADS */
+#endif // GamepadController_h

Powered by Google App Engine
This is Rietveld 408576698