diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-25 02:56:57 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-25 02:56:57 +0000 |
commit | 67fc03984940b07daa38970e6876fcec1fce0e8e (patch) | |
tree | cc4df6d037ecc5e0a479305856fa84137d62af93 /content/browser/webui/web_ui_handler_browsertest.h | |
parent | 31de2b56d10626c2328f43531931bc08348ebad2 (diff) | |
download | chromium_src-67fc03984940b07daa38970e6876fcec1fce0e8e.zip chromium_src-67fc03984940b07daa38970e6876fcec1fce0e8e.tar.gz chromium_src-67fc03984940b07daa38970e6876fcec1fce0e8e.tar.bz2 |
WebUI: Move the core files of WebUI from chrome/browser/webui to content/browser/webui.
BUG=59946
TEST=trybots
Review URL: http://codereview.chromium.org/6575054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/webui/web_ui_handler_browsertest.h')
-rw-r--r-- | content/browser/webui/web_ui_handler_browsertest.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/content/browser/webui/web_ui_handler_browsertest.h b/content/browser/webui/web_ui_handler_browsertest.h new file mode 100644 index 0000000..b19484a --- /dev/null +++ b/content/browser/webui/web_ui_handler_browsertest.h @@ -0,0 +1,40 @@ +// Copyright (c) 2011 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. + +#ifndef CONTENT_BROWSER_WEBUI_WEB_UI_HANDLER_BROWSERTEST_H_ +#define CONTENT_BROWSER_WEBUI_WEB_UI_HANDLER_BROWSERTEST_H_ +#pragma once + +#include <string> + +#include "content/browser/webui/web_ui.h" + +// This class registers test framework specific handlers on WebUI objects. +class WebUIHandlerBrowserTest : public WebUIMessageHandler { + public: + // Executes a string of javascript. Returns pass fail. + bool Execute(const std::string& js_test); + + protected: + // WebUI handlers which deliver results to any waiting message loops. + // |args| is currently ignored. + void HandlePass(const ListValue* args); + void HandleFail(const ListValue* args); + + // WebUIMessageHandler overrides. + // Add test handlers to the current WebUI object. + virtual void RegisterMessages(); + + private: + // Runs a message loop until test finishes. Returns the result of the test. + bool WaitForResult(); + + // Pass fail result of current tests. + bool test_succeeded_; + + // Waiting for a test to finish. + bool is_waiting_; +}; + +#endif // CONTENT_BROWSER_WEBUI_WEB_UI_HANDLER_BROWSERTEST_H_ |