| Index: content/test/layout_tests/runner/TextInputController.h
|
| diff --git a/third_party/tcmalloc/chromium/src/base/thread_lister.c b/content/test/layout_tests/runner/TextInputController.h
|
| similarity index 52%
|
| copy from third_party/tcmalloc/chromium/src/base/thread_lister.c
|
| copy to content/test/layout_tests/runner/TextInputController.h
|
| index bc180dba7a9f2ba3b8261009c8af85f0b1d4a023..f177176c1846888e13b5dd1e50bdf39f17622b18 100644
|
| --- a/third_party/tcmalloc/chromium/src/base/thread_lister.c
|
| +++ b/content/test/layout_tests/runner/TextInputController.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) 2010 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,43 @@
|
| * 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.
|
| - */
|
| +// TextInputController is bound to window.textInputController in Javascript
|
| +// when DRT is running. Layout tests use it to exercise various corners of
|
| +// text input.
|
|
|
| -#ifndef THREADS
|
| -
|
| -/* Default trivial thread lister for single-threaded applications,
|
| - * or if the multi-threading code has not been ported, yet.
|
| - */
|
| +#ifndef TextInputController_h
|
| +#define TextInputController_h
|
|
|
| -int ListAllProcessThreads(void *parameter,
|
| - ListAllProcessThreadsCallBack callback, ...) {
|
| - int rc;
|
| - va_list ap;
|
| - pid_t pid;
|
| +#include "content/test/layout_tests/runner/CppBoundClass.h"
|
|
|
| -#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;
|
| +namespace blink {
|
| +class WebView;
|
| }
|
|
|
| -int ResumeAllProcessThreads(int num_threads, pid_t *thread_pids) {
|
| - return 1;
|
| +namespace WebTestRunner {
|
| +
|
| +class TextInputController : public CppBoundClass {
|
| +public:
|
| + TextInputController();
|
| +
|
| + void setWebView(blink::WebView* webView) { m_webView = webView; }
|
| +
|
| + void insertText(const CppArgumentList&, CppVariant*);
|
| + void doCommand(const CppArgumentList&, CppVariant*);
|
| + void setMarkedText(const CppArgumentList&, CppVariant*);
|
| + void unmarkText(const CppArgumentList&, CppVariant*);
|
| + void hasMarkedText(const CppArgumentList&, CppVariant*);
|
| + void markedRange(const CppArgumentList&, CppVariant*);
|
| + void selectedRange(const CppArgumentList&, CppVariant*);
|
| + void firstRectForCharacterRange(const CppArgumentList&, CppVariant*);
|
| + void setComposition(const CppArgumentList&, CppVariant*);
|
| +
|
| +private:
|
| + blink::WebView* m_webView;
|
| +};
|
| +
|
| }
|
|
|
| -#endif /* ifndef THREADS */
|
| +#endif // TextInputController_h
|
|
|