summaryrefslogtreecommitdiffstats
path: root/android_webview/browser
diff options
context:
space:
mode:
authormkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 19:11:23 +0000
committermkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 19:11:23 +0000
commit5d730a3e630bf6adc3f86dcdcf2996099f72c9d1 (patch)
treeb5cf624921f679deda8625efa80111494704b07b /android_webview/browser
parent0700dcd1c6cdeb93d131612155ac77fe454531d2 (diff)
downloadchromium_src-5d730a3e630bf6adc3f86dcdcf2996099f72c9d1.zip
chromium_src-5d730a3e630bf6adc3f86dcdcf2996099f72c9d1.tar.gz
chromium_src-5d730a3e630bf6adc3f86dcdcf2996099f72c9d1.tar.bz2
Add a test runner for android_webview.
This change adds the necessary build rules for an android_webview test APK and test runner APK and a trivial test case. This change also adds a static Java library target to the WebContentsDelegateAndroid component. BUG= Review URL: https://chromiumcodereview.appspot.com/10855171 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153046 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser')
-rw-r--r--android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc44
-rw-r--r--android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h40
2 files changed, 84 insertions, 0 deletions
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
new file mode 100644
index 0000000..9bf0bc2
--- /dev/null
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 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 "android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "content/public/browser/resource_dispatcher_host.h"
+#include "content/public/browser/resource_throttle.h"
+
+namespace {
+
+base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate>
+ g_webview_resource_dispatcher_host_delegate = LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
+
+namespace android_webview {
+
+// static
+void AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated() {
+ content::ResourceDispatcherHost::Get()->SetDelegate(
+ &g_webview_resource_dispatcher_host_delegate.Get());
+}
+
+AwResourceDispatcherHostDelegate::AwResourceDispatcherHostDelegate()
+ : content::ResourceDispatcherHostDelegate() {
+}
+
+AwResourceDispatcherHostDelegate::~AwResourceDispatcherHostDelegate() {
+}
+
+void AwResourceDispatcherHostDelegate::RequestBeginning(
+ net::URLRequest* request,
+ content::ResourceContext* resource_context,
+ ResourceType::Type resource_type,
+ int child_id,
+ int route_id,
+ bool is_continuation_of_transferred_request,
+ ScopedVector<content::ResourceThrottle>* throttles) {
+}
+
+}
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h
new file mode 100644
index 0000000..e7e4142
--- /dev/null
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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 ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+#define ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+
+#include "content/public/browser/resource_dispatcher_host_delegate.h"
+
+#include "base/lazy_instance.h"
+
+namespace android_webview {
+
+class AwResourceDispatcherHostDelegate
+ : public content::ResourceDispatcherHostDelegate {
+ public:
+ static void ResourceDispatcherHostCreated();
+
+ // Overriden methods from ResourceDispatcherHostDelegate.
+ virtual void RequestBeginning(
+ net::URLRequest* request,
+ content::ResourceContext* resource_context,
+ ResourceType::Type resource_type,
+ int child_id,
+ int route_id,
+ bool is_continuation_of_transferred_request,
+ ScopedVector<content::ResourceThrottle>* throttles);
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<
+ AwResourceDispatcherHostDelegate>;
+ AwResourceDispatcherHostDelegate();
+ virtual ~AwResourceDispatcherHostDelegate();
+
+ DISALLOW_COPY_AND_ASSIGN(AwResourceDispatcherHostDelegate);
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_LIB_RENDERER_HOST_AW_RESOURCE_DISPATCHER_HOST_H_