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

Unified Diff: chrome_frame/test/net/test_automation_provider.h

Issue 218019: Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months 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_frame/test/net/test_automation_provider.h
===================================================================
--- chrome_frame/test/net/test_automation_provider.h (revision 0)
+++ chrome_frame/test/net/test_automation_provider.h (revision 0)
@@ -0,0 +1,52 @@
+// 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_FRAME_TEST_NET_TEST_AUTOMATION_PROVIDER_H_
+#define CHROME_FRAME_TEST_NET_TEST_AUTOMATION_PROVIDER_H_
+
+#include "chrome/browser/automation/automation_provider.h"
+
+class TestAutomationResourceMessageFilter;
+
+// Callback interface for TestAutomationProvider.
+class TestAutomationProviderDelegate {
+ public:
+ virtual void OnInitialTabLoaded() = 0;
+};
+
+// A slightly customized version of AutomationProvider.
+// We override AutomationProvider to be able to filter received messages
+// (see TestAutomationResourceMessageFilter) and know when the initial
+// ExternalTab has been loaded.
+// In order to intercept UrlRequests and make the URLRequestAutomationJob class
+// handle requests from unit tests, we also implement URLRequest::Interceptor.
+class TestAutomationProvider
+ : public AutomationProvider,
+ public URLRequest::Interceptor {
+ public:
+ explicit TestAutomationProvider(Profile* profile,
+ TestAutomationProviderDelegate* delegate);
+
+ virtual ~TestAutomationProvider();
+
+ // AutomationProvider overrides.
+ virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool Send(IPC::Message* msg);
+
+ // URLRequest::Interceptor.
+ virtual URLRequestJob* MaybeIntercept(URLRequest* request);
+
+ // Call to instantiate and initialize a new instance of
+ // TestAutomationProvider.
+ static TestAutomationProvider* NewAutomationProvider(
+ Profile* p,
+ const std::string& channel,
+ TestAutomationProviderDelegate* delegate);
+
+ protected:
+ scoped_refptr<TestAutomationResourceMessageFilter> filter_;
+ int tab_handle_;
+ TestAutomationProviderDelegate* delegate_;
+};
+
+#endif CHROME_FRAME_TEST_NET_TEST_AUTOMATION_PROVIDER_H_
« no previous file with comments | « chrome_frame/test/net/process_singleton_subclass.cc ('k') | chrome_frame/test/net/test_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698