| OLD | NEW |
| 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 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 5 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2470 web_modal::WebContentsModalDialogManager::FromWebContents(contents2); | 2470 web_modal::WebContentsModalDialogManager::FromWebContents(contents2); |
| 2471 | 2471 |
| 2472 // Show a dialog that blocks tab |contents2|. | 2472 // Show a dialog that blocks tab |contents2|. |
| 2473 // DummySingleWebContentsDialogManager doesn't care about the | 2473 // DummySingleWebContentsDialogManager doesn't care about the |
| 2474 // dialog window value, so any dummy value works. | 2474 // dialog window value, so any dummy value works. |
| 2475 DummySingleWebContentsDialogManager* native_manager = | 2475 DummySingleWebContentsDialogManager* native_manager = |
| 2476 new DummySingleWebContentsDialogManager( | 2476 new DummySingleWebContentsDialogManager( |
| 2477 reinterpret_cast<gfx::NativeWindow>(0), modal_dialog_manager); | 2477 reinterpret_cast<gfx::NativeWindow>(0), modal_dialog_manager); |
| 2478 modal_dialog_manager->ShowDialogWithManager( | 2478 modal_dialog_manager->ShowDialogWithManager( |
| 2479 reinterpret_cast<gfx::NativeWindow>(0), | 2479 reinterpret_cast<gfx::NativeWindow>(0), |
| 2480 scoped_ptr<web_modal::SingleWebContentsDialogManager>( | 2480 scoped_ptr<web_modal::SingleWebContentsDialogManager>(native_manager)); |
| 2481 native_manager).Pass()); | |
| 2482 EXPECT_TRUE(strip_src.IsTabBlocked(1)); | 2481 EXPECT_TRUE(strip_src.IsTabBlocked(1)); |
| 2483 | 2482 |
| 2484 // Detach the tab. | 2483 // Detach the tab. |
| 2485 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); | 2484 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); |
| 2486 EXPECT_EQ(contents2, moved_contents); | 2485 EXPECT_EQ(contents2, moved_contents); |
| 2487 | 2486 |
| 2488 // Attach the tab to the destination tab strip. | 2487 // Attach the tab to the destination tab strip. |
| 2489 strip_dst.AppendWebContents(moved_contents, true); | 2488 strip_dst.AppendWebContents(moved_contents, true); |
| 2490 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); | 2489 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); |
| 2491 | 2490 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2518 WebContents* page_d_contents = CreateWebContents(); | 2517 WebContents* page_d_contents = CreateWebContents(); |
| 2519 strip.AddWebContents(page_c_contents, -1, ui::PAGE_TRANSITION_LINK, | 2518 strip.AddWebContents(page_c_contents, -1, ui::PAGE_TRANSITION_LINK, |
| 2520 TabStripModel::ADD_NONE); | 2519 TabStripModel::ADD_NONE); |
| 2521 strip.AddWebContents(page_d_contents, -1, ui::PAGE_TRANSITION_LINK, | 2520 strip.AddWebContents(page_d_contents, -1, ui::PAGE_TRANSITION_LINK, |
| 2522 TabStripModel::ADD_NONE); | 2521 TabStripModel::ADD_NONE); |
| 2523 | 2522 |
| 2524 EXPECT_EQ(2, strip.GetIndexOfWebContents(page_c_contents)); | 2523 EXPECT_EQ(2, strip.GetIndexOfWebContents(page_c_contents)); |
| 2525 EXPECT_EQ(3, strip.GetIndexOfWebContents(page_d_contents)); | 2524 EXPECT_EQ(3, strip.GetIndexOfWebContents(page_d_contents)); |
| 2526 strip.CloseAllTabs(); | 2525 strip.CloseAllTabs(); |
| 2527 } | 2526 } |
| OLD | NEW |