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

Unified Diff: chrome/test/data/webui/async_gen-inl.h

Issue 8586009: Allow WebUI Tests to use preLoad in HtmlDialogUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reduce GEN(' ') (indentations) by moving code to .cc and .h file(s). Created 9 years, 1 month 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: chrome/test/data/webui/async_gen-inl.h
diff --git a/chrome/test/data/webui/async_gen-inl.h b/chrome/test/data/webui/async_gen-inl.h
deleted file mode 100644
index fae1af4c83d2d07390c7cf9e33b8e134cb796377..0000000000000000000000000000000000000000
--- a/chrome/test/data/webui/async_gen-inl.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// 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.
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/values.h"
-#include "chrome/browser/ui/webui/web_ui_browsertest.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-// C++ support class for javascript-generated asynchronous tests.
-class WebUIBrowserAsyncGenTest : public WebUIBrowserTest {
- public:
- WebUIBrowserAsyncGenTest();
- virtual ~WebUIBrowserAsyncGenTest();
-
- protected:
- class AsyncWebUIMessageHandler : public WebUIMessageHandler {
- public:
- AsyncWebUIMessageHandler();
- ~AsyncWebUIMessageHandler();
-
- MOCK_METHOD1(HandleTornDown, void(const base::ListValue*));
-
- private:
- void HandleCallJS(const base::ListValue* list_value) {
- std::string call_js;
- ASSERT_TRUE(list_value->GetString(0, &call_js));
- web_ui_->CallJavascriptFunction(call_js);
- }
-
- virtual void RegisterMessages() OVERRIDE {
- web_ui_->RegisterMessageCallback(
- "callJS", base::Bind(&AsyncWebUIMessageHandler::HandleCallJS,
- base::Unretained(this)));
- web_ui_->RegisterMessageCallback(
- "tornDown", base::Bind(&AsyncWebUIMessageHandler::HandleTornDown,
- base::Unretained(this)));
- }
- };
-
- // Handler for this test fixture.
- ::testing::StrictMock<AsyncWebUIMessageHandler> message_handler_;
-
- private:
- // Provide this object's handler.
- virtual WebUIMessageHandler* GetMockMessageHandler() OVERRIDE {
- return &message_handler_;
- }
-
- virtual void SetUpOnMainThread() OVERRIDE {
- WebUIBrowserTest::SetUpOnMainThread();
- EXPECT_CALL(message_handler_, HandleTornDown(::testing::_));
- }
-
- DISALLOW_COPY_AND_ASSIGN(WebUIBrowserAsyncGenTest);
-};

Powered by Google App Engine
This is Rietveld 408576698