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

Side by Side Diff: Source/web/tests/FrameTestHelpers.h

Issue 23506013: Make the embedder responsible for creating the WebFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add WebViewHelper for unittests. Created 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 namespace WebKit { 37 namespace WebKit {
38 38
39 class WebFrame; 39 class WebFrame;
40 class WebFrameClient; 40 class WebFrameClient;
41 class WebView; 41 class WebView;
42 class WebViewClient; 42 class WebViewClient;
43 43
44 namespace FrameTestHelpers { 44 namespace FrameTestHelpers {
45 45
46 void loadFrame(WebFrame*, const std::string& url); 46 void loadFrame(WebFrame*, const std::string& url);
47 void runPendingTasks();
47 48
48 WebView* createWebView(bool enableJavascript = false, WebFrameClient* = 0, WebVi ewClient* = 0); 49 class WebViewHelper {
49 WebView* createWebViewAndLoad(const std::string& url, bool enableJavascript = fa lse, WebFrameClient* = 0, WebViewClient* = 0); 50 public:
51 WebViewHelper();
52 ~WebViewHelper();
50 53
51 void runPendingTasks(); 54 WebView* initialize(bool enableJavascript = false, WebFrameClient* = 0, WebV iewClient* = 0);
55 WebView* initializeAndLoad(const std::string& url, bool enableJavascript = f alse, WebFrameClient* = 0, WebViewClient* = 0);
56
57 void reset();
58
59 WebView* webView() { return m_webView; }
60
61 private:
62 WebFrame* m_mainFrame;
63 WebView* m_webView;
64 };
52 65
53 } // namespace FrameTestHelpers 66 } // namespace FrameTestHelpers
54 } // namespace WebKit 67 } // namespace WebKit
55 68
56 #endif // FrameTestHelpers_h 69 #endif // FrameTestHelpers_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698