| Index: content/public/test/layout_tests/WebTestRunner.h
|
| diff --git a/third_party/tcmalloc/vendor/src/base/thread_lister.c b/content/public/test/layout_tests/WebTestRunner.h
|
| similarity index 52%
|
| copy from third_party/tcmalloc/vendor/src/base/thread_lister.c
|
| copy to content/public/test/layout_tests/WebTestRunner.h
|
| index bc180dba7a9f2ba3b8261009c8af85f0b1d4a023..e829321216d3d06e7f139c596436ddf01051b5de 100644
|
| --- a/third_party/tcmalloc/vendor/src/base/thread_lister.c
|
| +++ b/content/public/test/layout_tests/WebTestRunner.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) 2012 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,42 @@
|
| * 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 WebTestRunner_h
|
| +#define WebTestRunner_h
|
|
|
| -#ifndef THREADS
|
| +namespace blink {
|
| +class WebArrayBufferView;
|
| +class WebPermissionClient;
|
| +}
|
|
|
| -/* Default trivial thread lister for single-threaded applications,
|
| - * or if the multi-threading code has not been ported, yet.
|
| - */
|
| +namespace WebTestRunner {
|
|
|
| -int ListAllProcessThreads(void *parameter,
|
| - ListAllProcessThreadsCallBack callback, ...) {
|
| - int rc;
|
| - va_list ap;
|
| - pid_t pid;
|
| +class WebTestRunner {
|
| +public:
|
| + // Returns a mock WebPermissionClient that is used for layout tests. An
|
| + // embedder should use this for all WebViews it creates.
|
| + virtual blink::WebPermissionClient* webPermissions() const = 0;
|
|
|
| -#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;
|
| -}
|
| + // After WebTestDelegate::testFinished was invoked, the following methods
|
| + // can be used to determine what kind of dump the main WebTestProxy can
|
| + // provide.
|
| +
|
| + // If true, WebTestDelegate::audioData returns an audio dump and no text
|
| + // or pixel results are available.
|
| + virtual bool shouldDumpAsAudio() const = 0;
|
| + virtual const blink::WebArrayBufferView* audioData() const = 0;
|
| +
|
| + // Returns true if the call to WebTestProxy::captureTree will invoke
|
| + // WebTestDelegate::captureHistoryForWindow.
|
| + virtual bool shouldDumpBackForwardList() const = 0;
|
| +
|
| + // Returns true if WebTestProxy::capturePixels should be invoked after
|
| + // capturing text results.
|
| + virtual bool shouldGeneratePixelResults() = 0;
|
| +};
|
|
|
| -int ResumeAllProcessThreads(int num_threads, pid_t *thread_pids) {
|
| - return 1;
|
| }
|
|
|
| -#endif /* ifndef THREADS */
|
| +#endif // WebTestRunner_h
|
|
|