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

Side by Side Diff: content/public/test/browser_test_utils.h

Issue 2407713002: Limit PDF helper extension to print preview only (Closed)
Patch Set: Use location.origin instead of location.ancestorOrigins. Created 4 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
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/files/scoped_temp_dir.h" 14 #include "base/files/scoped_temp_dir.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/process/process.h" 17 #include "base/process/process.h"
18 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "cc/output/compositor_frame.h" 20 #include "cc/output/compositor_frame.h"
21 #include "content/public/browser/browser_message_filter.h" 21 #include "content/public/browser/browser_message_filter.h"
22 #include "content/public/browser/notification_observer.h" 22 #include "content/public/browser/notification_observer.h"
23 #include "content/public/browser/notification_registrar.h" 23 #include "content/public/browser/notification_registrar.h"
24 #include "content/public/browser/render_process_host_observer.h" 24 #include "content/public/browser/render_process_host_observer.h"
25 #include "content/public/browser/web_contents_delegate.h"
25 #include "content/public/browser/web_contents_observer.h" 26 #include "content/public/browser/web_contents_observer.h"
26 #include "content/public/common/page_type.h" 27 #include "content/public/common/page_type.h"
27 #include "ipc/message_filter.h" 28 #include "ipc/message_filter.h"
28 #include "third_party/WebKit/public/web/WebInputEvent.h" 29 #include "third_party/WebKit/public/web/WebInputEvent.h"
29 #include "ui/accessibility/ax_node_data.h" 30 #include "ui/accessibility/ax_node_data.h"
30 #include "ui/accessibility/ax_tree_update.h" 31 #include "ui/accessibility/ax_tree_update.h"
31 #include "ui/events/keycodes/dom/dom_code.h" 32 #include "ui/events/keycodes/dom/dom_code.h"
32 #include "ui/events/keycodes/dom/dom_key.h" 33 #include "ui/events/keycodes/dom/dom_key.h"
33 #include "ui/events/keycodes/keyboard_codes.h" 34 #include "ui/events/keycodes/keyboard_codes.h"
34 #include "url/gurl.h" 35 #include "url/gurl.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 bool handled_navigation_; 651 bool handled_navigation_;
651 scoped_refptr<MessageLoopRunner> will_start_loop_runner_; 652 scoped_refptr<MessageLoopRunner> will_start_loop_runner_;
652 scoped_refptr<MessageLoopRunner> will_process_response_loop_runner_; 653 scoped_refptr<MessageLoopRunner> will_process_response_loop_runner_;
653 scoped_refptr<MessageLoopRunner> did_finish_loop_runner_; 654 scoped_refptr<MessageLoopRunner> did_finish_loop_runner_;
654 655
655 base::WeakPtrFactory<TestNavigationManager> weak_factory_; 656 base::WeakPtrFactory<TestNavigationManager> weak_factory_;
656 657
657 DISALLOW_COPY_AND_ASSIGN(TestNavigationManager); 658 DISALLOW_COPY_AND_ASSIGN(TestNavigationManager);
658 }; 659 };
659 660
661 // A WebContentsDelegate that catches messages sent to the console.
662 class ConsoleObserverDelegate : public WebContentsDelegate {
663 public:
664 ConsoleObserverDelegate(WebContents* web_contents, const std::string& filter);
665 ~ConsoleObserverDelegate() override;
666
667 // WebContentsDelegate method:
668 bool AddMessageToConsole(WebContents* source,
669 int32_t level,
670 const base::string16& message,
671 int32_t line_no,
672 const base::string16& source_id) override;
673
674 // Returns the most recent message sent to the console.
675 std::string message() { return message_; }
676
677 // Waits for the next message captured by the filter to be sent to the
678 // console.
679 void Wait();
680
681 private:
682 WebContents* web_contents_;
683 std::string filter_;
684 std::string message_;
685
686 // The MessageLoopRunner used to spin the message loop.
687 scoped_refptr<MessageLoopRunner> message_loop_runner_;
688
689 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate);
690 };
691
660 } // namespace content 692 } // namespace content
661 693
662 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 694 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698