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

Unified Diff: ios/web/test/web_test.h

Issue 1874903003: Reversed WebState <-> CRWWebController ownership. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged with origin/master Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/shell/view_controller.mm ('k') | ios/web/test/web_test.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/test/web_test.h
diff --git a/ios/web/test/web_test.h b/ios/web/test/web_test.h
index 8fa94691bf67b1c81f860dd9e1dbd051c466cd31..8f817d7ec3e7e03d304b1788d57019cb012e178f 100644
--- a/ios/web/test/web_test.h
+++ b/ios/web/test/web_test.h
@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h>
#import "base/ios/block_types.h"
+#import "base/ios/weak_nsobject.h"
#import "base/mac/scoped_nsobject.h"
#include "base/message_loop/message_loop.h"
#include "ios/web/public/test/scoped_testing_web_client.h"
@@ -49,8 +50,7 @@ class WebTest : public PlatformTest {
#pragma mark -
// An abstract test fixture that sets up a WebControllers that can be loaded
-// with test HTML and JavaScripts. Concrete subclasses override
-// |CreateWebController| specifying the test WebController object.
+// with test HTML and JavaScripts.
class WebTestWithWebController : public WebTest,
public base::MessageLoop::TaskObserver {
public:
@@ -82,14 +82,12 @@ class WebTestWithWebController : public WebTest,
// the additional functionality that any JavaScript exceptions are caught and
// logged (not dropped silently).
NSString* RunJavaScript(NSString* script);
- // Creates a CRWWebController to be used in tests.
- virtual CRWWebController* CreateWebController();
// TaskObserver methods (used when waiting for background tasks).
void WillProcessTask(const base::PendingTask& pending_task) override;
void DidProcessTask(const base::PendingTask& pending_task) override;
// The web controller for testing.
- base::scoped_nsobject<CRWWebController> webController_;
+ base::WeakNSObject<CRWWebController> webController_;
// true if a task has been processed.
bool processed_a_task_;
@@ -102,6 +100,8 @@ class WebTestWithWebController : public WebTest,
// Creates a unique HTML element to look for in
// ResetPageIfNavigationStalled().
NSString* CreateLoadCheck();
+ // The web state for testing.
+ std::unique_ptr<WebStateImpl> web_state_impl_;
};
} // namespace web
« no previous file with comments | « ios/web/shell/view_controller.mm ('k') | ios/web/test/web_test.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698