| Index: components/web_modal/web_contents_modal_dialog_manager_unittest.cc
|
| diff --git a/components/web_modal/web_contents_modal_dialog_manager_unittest.cc b/components/web_modal/web_contents_modal_dialog_manager_unittest.cc
|
| index a4f65ac809fbccb1680c9c91be836bdc07259d67..ea07abf9baff7946bc36fd9d029315d076d5532c 100644
|
| --- a/components/web_modal/web_contents_modal_dialog_manager_unittest.cc
|
| +++ b/components/web_modal/web_contents_modal_dialog_manager_unittest.cc
|
| @@ -43,7 +43,7 @@ class TestNativeWebContentsModalDialogManager
|
| : public SingleWebContentsDialogManager {
|
| public:
|
| TestNativeWebContentsModalDialogManager(
|
| - NativeWebContentsModalDialog dialog,
|
| + gfx::NativeWindow dialog,
|
| SingleWebContentsDialogManagerDelegate* delegate,
|
| NativeManagerTracker* tracker)
|
| : delegate_(delegate),
|
| @@ -69,7 +69,7 @@ class TestNativeWebContentsModalDialogManager
|
| void Focus() override {}
|
| void Pulse() override {}
|
| void HostChanged(WebContentsModalDialogHost* new_host) override {}
|
| - NativeWebContentsModalDialog dialog() override { return dialog_; }
|
| + gfx::NativeWindow dialog() override { return dialog_; }
|
|
|
| void StopTracking() {
|
| tracker_ = NULL;
|
| @@ -77,7 +77,7 @@ class TestNativeWebContentsModalDialogManager
|
|
|
| private:
|
| SingleWebContentsDialogManagerDelegate* delegate_;
|
| - NativeWebContentsModalDialog dialog_;
|
| + gfx::NativeWindow dialog_;
|
| NativeManagerTracker* tracker_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TestNativeWebContentsModalDialogManager);
|
| @@ -107,11 +107,10 @@ class WebContentsModalDialogManagerTest
|
| }
|
|
|
| protected:
|
| - NativeWebContentsModalDialog MakeFakeDialog() {
|
| - // WebContentsModalDialogManager treats the NativeWebContentsModalDialog as
|
| - // an opaque type, so creating fake NativeWebContentsModalDialogs using
|
| - // reinterpret_cast is valid.
|
| - return reinterpret_cast<NativeWebContentsModalDialog>(next_dialog_id++);
|
| + gfx::NativeWindow MakeFakeDialog() {
|
| + // WebContentsModalDialogManager treats the dialog window as an opaque
|
| + // type, so creating fake dialog windows using reinterpret_cast is valid.
|
| + return reinterpret_cast<gfx::NativeWindow>(next_dialog_id++);
|
| }
|
|
|
| int next_dialog_id;
|
| @@ -124,7 +123,7 @@ class WebContentsModalDialogManagerTest
|
|
|
| SingleWebContentsDialogManager*
|
| WebContentsModalDialogManager::CreateNativeWebModalManager(
|
| - NativeWebContentsModalDialog dialog,
|
| + gfx::NativeWindow dialog,
|
| SingleWebContentsDialogManagerDelegate* native_delegate) {
|
| NOTREACHED();
|
| return new TestNativeWebContentsModalDialogManager(
|
| @@ -137,7 +136,7 @@ WebContentsModalDialogManager::CreateNativeWebModalManager(
|
| // contents is visible.
|
| TEST_F(WebContentsModalDialogManagerTest, WebContentsVisible) {
|
| // Dialog should be shown while WebContents is visible.
|
| - const NativeWebContentsModalDialog dialog = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog = MakeFakeDialog();
|
|
|
| NativeManagerTracker tracker;
|
| TestNativeWebContentsModalDialogManager* native_manager =
|
| @@ -159,7 +158,7 @@ TEST_F(WebContentsModalDialogManagerTest, WebContentsNotVisible) {
|
| // Dialog should not be shown while WebContents is not visible.
|
| delegate->set_web_contents_visible(false);
|
|
|
| - const NativeWebContentsModalDialog dialog = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog = MakeFakeDialog();
|
|
|
| NativeManagerTracker tracker;
|
| TestNativeWebContentsModalDialogManager* native_manager =
|
| @@ -177,9 +176,9 @@ TEST_F(WebContentsModalDialogManagerTest, WebContentsNotVisible) {
|
|
|
| // Test that only the first of multiple dialogs is shown.
|
| TEST_F(WebContentsModalDialogManagerTest, ShowDialogs) {
|
| - const NativeWebContentsModalDialog dialog1 = MakeFakeDialog();
|
| - const NativeWebContentsModalDialog dialog2 = MakeFakeDialog();
|
| - const NativeWebContentsModalDialog dialog3 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog1 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog2 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog3 = MakeFakeDialog();
|
|
|
| NativeManagerTracker tracker1;
|
| NativeManagerTracker tracker2;
|
| @@ -209,7 +208,7 @@ TEST_F(WebContentsModalDialogManagerTest, ShowDialogs) {
|
|
|
| // Test that the dialog is shown/hidden when the WebContents is shown/hidden.
|
| TEST_F(WebContentsModalDialogManagerTest, VisibilityObservation) {
|
| - const NativeWebContentsModalDialog dialog = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog = MakeFakeDialog();
|
|
|
| NativeManagerTracker tracker;
|
| TestNativeWebContentsModalDialogManager* native_manager =
|
| @@ -238,8 +237,8 @@ TEST_F(WebContentsModalDialogManagerTest, VisibilityObservation) {
|
|
|
| // Test that attaching an interstitial page closes all dialogs.
|
| TEST_F(WebContentsModalDialogManagerTest, InterstitialPage) {
|
| - const NativeWebContentsModalDialog dialog1 = MakeFakeDialog();
|
| - const NativeWebContentsModalDialog dialog2 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog1 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog2 = MakeFakeDialog();
|
|
|
| NativeManagerTracker tracker1;
|
| NativeManagerTracker tracker2;
|
| @@ -276,10 +275,10 @@ TEST_F(WebContentsModalDialogManagerTest, InterstitialPage) {
|
| // dialogs are closed.
|
| TEST_F(WebContentsModalDialogManagerTest, CloseDialogs) {
|
| // The front dialog is always shown regardless of dialog close order.
|
| - const NativeWebContentsModalDialog dialog1 = MakeFakeDialog();
|
| - const NativeWebContentsModalDialog dialog2 = MakeFakeDialog();
|
| - const NativeWebContentsModalDialog dialog3 = MakeFakeDialog();
|
| - const NativeWebContentsModalDialog dialog4 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog1 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog2 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog3 = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog4 = MakeFakeDialog();
|
|
|
| NativeManagerTracker tracker1;
|
| NativeManagerTracker tracker2;
|
| @@ -351,7 +350,7 @@ TEST_F(WebContentsModalDialogManagerTest, CloseAllDialogs) {
|
| NativeManagerTracker trackers[kWindowCount];
|
| TestNativeWebContentsModalDialogManager* native_managers[kWindowCount];
|
| for (int i = 0; i < kWindowCount; i++) {
|
| - const NativeWebContentsModalDialog dialog = MakeFakeDialog();
|
| + const gfx::NativeWindow dialog = MakeFakeDialog();
|
| native_managers[i] =
|
| new TestNativeWebContentsModalDialogManager(
|
| dialog, manager, &(trackers[i]));
|
|
|