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

Side by Side Diff: android_webview/native/permission/permission_request_handler_unittest.cc

Issue 288463003: Cancel the permission request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittests Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « android_webview/native/permission/permission_request_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/native/permission/aw_permission_request.h" 5 #include "android_webview/native/permission/aw_permission_request.h"
6 #include "android_webview/native/permission/aw_permission_request_delegate.h" 6 #include "android_webview/native/permission/aw_permission_request_delegate.h"
7 #include "android_webview/native/permission/permission_request_handler.h" 7 #include "android_webview/native/permission/permission_request_handler.h"
8 #include "android_webview/native/permission/permission_request_handler_client.h" 8 #include "android_webview/native/permission/permission_request_handler_client.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 private: 100 private:
101 AwPermissionRequest* request_; 101 AwPermissionRequest* request_;
102 Permission requested_permission_; 102 Permission requested_permission_;
103 Permission canceled_permission_; 103 Permission canceled_permission_;
104 }; 104 };
105 105
106 class TestPermissionRequestHandler : public PermissionRequestHandler { 106 class TestPermissionRequestHandler : public PermissionRequestHandler {
107 public: 107 public:
108 TestPermissionRequestHandler(PermissionRequestHandlerClient* client) 108 TestPermissionRequestHandler(PermissionRequestHandlerClient* client)
109 : PermissionRequestHandler(client) { 109 : PermissionRequestHandler(client, NULL) {
110 } 110 }
111 111
112 const std::vector<base::WeakPtr<AwPermissionRequest> > requests() { 112 const std::vector<base::WeakPtr<AwPermissionRequest> > requests() {
113 return requests_; 113 return requests_;
114 } 114 }
115 115
116 void PruneRequests() { 116 void PruneRequests() {
117 return PermissionRequestHandler::PruneRequests(); 117 return PermissionRequestHandler::PruneRequests();
118 } 118 }
119 }; 119 };
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 delegate.reset(new TestAwPermissionRequestDelegate( 343 delegate.reset(new TestAwPermissionRequestDelegate(
344 origin_hostname, AwPermissionRequest::Geolocation, 344 origin_hostname, AwPermissionRequest::Geolocation,
345 base::Bind(&PermissionRequestHandlerTest::NotifyRequestResult, 345 base::Bind(&PermissionRequestHandlerTest::NotifyRequestResult,
346 base::Unretained(this)))); 346 base::Unretained(this))));
347 handler()->SendRequest(delegate.Pass()); 347 handler()->SendRequest(delegate.Pass());
348 EXPECT_TRUE(allowed()); 348 EXPECT_TRUE(allowed());
349 EXPECT_EQ(NULL, client()->request()); 349 EXPECT_EQ(NULL, client()->request());
350 } 350 }
351 351
352 } // android_webview 352 } // android_webview
OLDNEW
« no previous file with comments | « android_webview/native/permission/permission_request_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698