diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 06:10:31 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 06:10:31 +0000 |
commit | ad23b99078f3db28bf5e88821cadc2d5effac52b (patch) | |
tree | 0df04a0908e71c383853e71f7586c381cbc4b9c8 /chrome/test/render_view_test.h | |
parent | 0c9366d5f357759e3bd968a267b6eb1100e5835c (diff) | |
download | chromium_src-ad23b99078f3db28bf5e88821cadc2d5effac52b.zip chromium_src-ad23b99078f3db28bf5e88821cadc2d5effac52b.tar.gz chromium_src-ad23b99078f3db28bf5e88821cadc2d5effac52b.tar.bz2 |
Add JsonSchema-based validation for the tab APIs.
Arv: can you take json_schema.js and json_schema_test.js.
Matt: you take the rest.
Review URL: http://codereview.chromium.org/66006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/render_view_test.h')
-rw-r--r-- | chrome/test/render_view_test.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/chrome/test/render_view_test.h b/chrome/test/render_view_test.h new file mode 100644 index 0000000..abda898 --- /dev/null +++ b/chrome/test/render_view_test.h @@ -0,0 +1,47 @@ +// Copyright (c) 2009 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 CHROME_TEST_RENDER_VIEW_TEST_H_ +#define CHROME_TEST_RENDER_VIEW_TEST_H_ + +#include "base/scoped_ptr.h" +#include "chrome/renderer/mock_render_process.h" +#include "chrome/renderer/mock_render_thread.h" +#include "chrome/renderer/render_view.h" +#include "chrome/renderer/renderer_webkitclient_impl.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "webkit/glue/webframe.h" + +class RenderViewTest : public testing::Test { + public: + RenderViewTest() {} + ~RenderViewTest() {} + + protected: + // Spins the message loop to process all messages that are currently pending. + void ProcessPendingMessages(); + + // Returns a pointer to the main frame. + WebFrame* GetMainFrame(); + + // Executes the given JavaScript in the context of the main frame. The input + // is a NULL-terminated UTF-8 string. + void ExecuteJavaScript(const char* js); + + // Loads the given HTML into the main frame as a data: URL. + void LoadHTML(const char* html); + + // testing::Test + virtual void SetUp(); + + virtual void TearDown(); + + MessageLoop msg_loop_; + MockRenderThread render_thread_; + scoped_ptr<MockProcess> mock_process_; + scoped_refptr<RenderView> view_; + RendererWebKitClientImpl webkitclient_; +}; + +#endif // CHROME_TEST_RENDER_VIEW_TEST_H_ |