| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h" | |
| 6 | |
| 7 #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 | |
| 10 TabModalConfirmDialog* TabModalConfirmDialogTest::CreateTestDialog( | |
| 11 TabModalConfirmDialogDelegate* delegate, TabContents* tab_contents) { | |
| 12 return new TabModalConfirmDialogMac(delegate, tab_contents); | |
| 13 } | |
| 14 | |
| 15 void TabModalConfirmDialogTest::CloseDialog(bool accept) { | |
| 16 NSWindow* window = [(NSAlert*)dialog_->sheet() window]; | |
| 17 ASSERT_TRUE(window); | |
| 18 ASSERT_TRUE(dialog_->is_sheet_open()); | |
| 19 [NSApp endSheet:window | |
| 20 returnCode:accept ? NSAlertFirstButtonReturn : | |
| 21 NSAlertSecondButtonReturn]; | |
| 22 } | |
| OLD | NEW |