| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/views/confirm_bubble_views.h" | 5 #include "chrome/browser/ui/views/confirm_bubble_views.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/confirm_bubble.h" | 7 #include "chrome/browser/ui/confirm_bubble.h" |
| 8 #include "chrome/browser/ui/test/test_confirm_bubble_model.h" | 8 #include "chrome/browser/ui/test/test_confirm_bubble_model.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/views/test/views_test_base.h" | 10 #include "ui/views/test/views_test_base.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 scoped_ptr<views::Widget> parent_widget(new Widget); | 21 scoped_ptr<views::Widget> parent_widget(new Widget); |
| 22 parent_widget->Init(params); | 22 parent_widget->Init(params); |
| 23 parent_widget->Show(); | 23 parent_widget->Show(); |
| 24 | 24 |
| 25 // Bubble owns the model. | 25 // Bubble owns the model. |
| 26 bool model_deleted = false; | 26 bool model_deleted = false; |
| 27 TestConfirmBubbleModel* model = | 27 TestConfirmBubbleModel* model = |
| 28 new TestConfirmBubbleModel(&model_deleted, NULL, NULL, NULL); | 28 new TestConfirmBubbleModel(&model_deleted, NULL, NULL, NULL); |
| 29 ConfirmBubbleViews* bubble = new ConfirmBubbleViews(model); | 29 ConfirmBubbleViews* bubble = new ConfirmBubbleViews(model); |
| 30 gfx::NativeView parent = parent_widget->GetNativeView(); | 30 gfx::NativeView parent = parent_widget->GetNativeView(); |
| 31 views::DialogDelegate::CreateDialogWidget(bubble, NULL, parent)->Show(); | 31 CreateBrowserModalDialogViews(bubble, parent)->Show(); |
| 32 | 32 |
| 33 // Clean up. | 33 // Clean up. |
| 34 bubble->GetWidget()->CloseNow(); | 34 bubble->GetWidget()->CloseNow(); |
| 35 parent_widget->CloseNow(); | 35 parent_widget->CloseNow(); |
| 36 EXPECT_TRUE(model_deleted); | 36 EXPECT_TRUE(model_deleted); |
| 37 } | 37 } |
| OLD | NEW |