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

Side by Side Diff: content/shell/renderer/test_runner/test_runner.h

Issue 584553002: Extend the TestRunner so that the manifest-src CSP directive can be tested from layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate feedback Created 6 years, 2 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
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 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "content/shell/renderer/test_runner/web_task.h" 14 #include "content/shell/renderer/test_runner/web_task.h"
15 #include "content/shell/renderer/test_runner/web_test_runner.h" 15 #include "content/shell/renderer/test_runner/web_test_runner.h"
16 #include "v8/include/v8.h" 16 #include "v8/include/v8.h"
17 17
18 class GURL; 18 class GURL;
19 class SkBitmap; 19 class SkBitmap;
20 20
21 namespace blink { 21 namespace blink {
22 class WebFrame; 22 class WebFrame;
23 class WebNotificationPresenter; 23 class WebNotificationPresenter;
24 class WebPermissionClient; 24 class WebPermissionClient;
25 class WebString; 25 class WebString;
26 class WebView; 26 class WebView;
27 class WebURLResponse;
27 } 28 }
28 29
29 namespace gin { 30 namespace gin {
30 class ArrayBufferView; 31 class ArrayBufferView;
31 class Arguments; 32 class Arguments;
32 } 33 }
33 34
34 namespace content { 35 namespace content {
35 36
36 class InvokeCallbackTask; 37 class InvokeCallbackTask;
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 const std::string& password); 544 const std::string& password);
544 545
545 // WebPageOverlay related functions. Permits the adding and removing of only 546 // WebPageOverlay related functions. Permits the adding and removing of only
546 // one opaque overlay. 547 // one opaque overlay.
547 void AddWebPageOverlay(); 548 void AddWebPageOverlay();
548 void RemoveWebPageOverlay(); 549 void RemoveWebPageOverlay();
549 550
550 void DisplayAsync(); 551 void DisplayAsync();
551 void DisplayAsyncThen(v8::Handle<v8::Function> callback); 552 void DisplayAsyncThen(v8::Handle<v8::Function> callback);
552 553
554 void GetManifestThen(v8::Handle<v8::Function> callback);
Mike West 2014/09/24 15:15:47 Nit: I'd suggest moving this down under the pixel
555
553 // Similar to DisplayAsyncThen(), but pass parameters of the captured 556 // Similar to DisplayAsyncThen(), but pass parameters of the captured
554 // snapshot (width, height, snapshot) to the callback. The snapshot is in 557 // snapshot (width, height, snapshot) to the callback. The snapshot is in
555 // uint8 RGBA format. 558 // uint8 RGBA format.
556 void CapturePixelsAsyncThen(v8::Handle<v8::Function> callback); 559 void CapturePixelsAsyncThen(v8::Handle<v8::Function> callback);
557 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image 560 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image
558 // located at a particular point in the WebView (if there is such an image), 561 // located at a particular point in the WebView (if there is such an image),
559 // reads back its pixels, and provides the snapshot to the callback. If there 562 // reads back its pixels, and provides the snapshot to the callback. If there
560 // is no image at that point, calls the callback with (0, 0, empty_snapshot). 563 // is no image at that point, calls the callback with (0, 0, empty_snapshot).
561 void CopyImageAtAndCapturePixelsAsyncThen( 564 void CopyImageAtAndCapturePixelsAsyncThen(
562 int x, int y, const v8::Handle<v8::Function> callback); 565 int x, int y, const v8::Handle<v8::Function> callback);
563 566
564 void SetMockPushClientSuccess(const std::string& endpoint, 567 void SetMockPushClientSuccess(const std::string& endpoint,
565 const std::string& registration_id); 568 const std::string& registration_id);
566 void SetMockPushClientError(const std::string& message); 569 void SetMockPushClientError(const std::string& message);
567 570
568 /////////////////////////////////////////////////////////////////////////// 571 ///////////////////////////////////////////////////////////////////////////
569 // Internal helpers 572 // Internal helpers
570 573
574 void GetManifestCallback(scoped_ptr<InvokeCallbackTask> task,
575 const blink::WebURLResponse& response,
576 const std::string& data);
571 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task, 577 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task,
572 const SkBitmap& snapshot); 578 const SkBitmap& snapshot);
573 579
574 void CheckResponseMimeType(); 580 void CheckResponseMimeType();
575 void CompleteNotifyDone(); 581 void CompleteNotifyDone();
576 582
577 void DidAcquirePointerLockInternal(); 583 void DidAcquirePointerLockInternal();
578 void DidNotAcquirePointerLockInternal(); 584 void DidNotAcquirePointerLockInternal();
579 void DidLosePointerLockInternal(); 585 void DidLosePointerLockInternal();
580 586
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 bool use_mock_theme_; 776 bool use_mock_theme_;
771 777
772 base::WeakPtrFactory<TestRunner> weak_factory_; 778 base::WeakPtrFactory<TestRunner> weak_factory_;
773 779
774 DISALLOW_COPY_AND_ASSIGN(TestRunner); 780 DISALLOW_COPY_AND_ASSIGN(TestRunner);
775 }; 781 };
776 782
777 } // namespace content 783 } // namespace content
778 784
779 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ 785 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698