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

Unified Diff: chrome/browser/chromeos/login/captive_portal_window_proxy.h

Issue 15780006: Added bowser test for Captive Portal Window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/captive_portal_window_proxy.h
diff --git a/chrome/browser/chromeos/login/captive_portal_window_proxy.h b/chrome/browser/chromeos/login/captive_portal_window_proxy.h
index 3c183b156c9e4b16604fd1a911703a4a609aa8d5..ac62a75d32e7b348f267cb95c901e7c6da6319a7 100644
--- a/chrome/browser/chromeos/login/captive_portal_window_proxy.h
+++ b/chrome/browser/chromeos/login/captive_portal_window_proxy.h
@@ -58,9 +58,35 @@ class CaptivePortalWindowProxy : public views::WidgetObserver {
void OnOriginalURLLoaded();
// Overridden from views::WidgetObserver:
- virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
+ virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
private:
+ friend class CaptivePortalWindowTest;
+
+ // Possible transitions between states:
+ //
+ // wp(ShowIfRedirected(), WAITING_FOR_REDIRECTION) = IDLE
+ // wp(Show(), DISPLAYED) = IDLE | WAITING_FOR_REDIRECTION
+ // wp(Close(), IDLE) = WAITING_FOR_REDIRECTION | DISPLAYED
+ // wp(OnRedirected(), DISPLAYED) = WAITING_FOR_REDIRECTION
+ // wp(OnOriginalURLLoaded(), IDLE) = WAITING_FOR_REDIRECTION | DISPLAYED
+ //
+ // where wp(E, S) is a weakest precondition (initial state) such
+ // that after execution of E the system will be surely in the state S.
+ enum State {
+ STATE_IDLE = 0,
+ STATE_WAITING_FOR_REDIRECTION,
+ STATE_DISPLAYED,
+ STATE_UNKNOWN
+ };
+
+ // Initializes |captive_portal_view_| if it is not initialized and
+ // starts loading Captive Portal redirect URL.
+ void InitCaptivePortalView();
+
+ // Returns symbolic state name based on internal state.
+ State GetState() const;
+
Delegate* delegate_;
views::Widget* widget_;
scoped_ptr<CaptivePortalView> captive_portal_view_;

Powered by Google App Engine
This is Rietveld 408576698