| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
| 8 #import "chrome/browser/cocoa/bug_report_window_controller.h" | 8 #import "chrome/browser/cocoa/bug_report_window_controller.h" |
| 9 #include "chrome/browser/renderer_host/site_instance.h" | 9 #include "chrome/browser/renderer_host/site_instance.h" |
| 10 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 10 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 delete tabContents; | 48 delete tabContents; |
| 49 [controller release]; | 49 [controller release]; |
| 50 } | 50 } |
| 51 | 51 |
| 52 TEST_F(BugReportWindowControllerUnittest, ReportBugWithNoWindowOpen) { | 52 TEST_F(BugReportWindowControllerUnittest, ReportBugWithNoWindowOpen) { |
| 53 BugReportWindowController* controller = [[BugReportWindowController alloc] | 53 BugReportWindowController* controller = [[BugReportWindowController alloc] |
| 54 initWithTabContents:NULL | 54 initWithTabContents:NULL |
| 55 profile:profile_.get()]; | 55 profile:profile_.get()]; |
| 56 | 56 |
| 57 // Make sure that no page title or URL are recorded. | 57 // Make sure that no page title or URL are recorded. Note that IB reports |
| 58 EXPECT_TRUE([[controller pageURL] isEqualToString:@""]); | 58 // empty textfields as NULL values. |
| 59 EXPECT_TRUE([[controller pageTitle] isEqualToString:@""]); | 59 EXPECT_FALSE([controller pageURL]); |
| 60 EXPECT_FALSE([controller pageTitle]); |
| 60 | 61 |
| 61 // When we call "report bug" with empty tab contents, only menu options | 62 // When we call "report bug" with empty tab contents, only menu options |
| 62 // that don't refer to a specific page should be available, and the send | 63 // that don't refer to a specific page should be available, and the send |
| 63 // screenshot option should be turned off. | 64 // screenshot option should be turned off. |
| 64 EXPECT_EQ([[controller bugTypeList] count], 4U); | 65 EXPECT_EQ([[controller bugTypeList] count], 4U); |
| 65 EXPECT_FALSE([controller sendScreenshot]); | 66 EXPECT_FALSE([controller sendScreenshot]); |
| 66 | 67 |
| 67 [controller release]; | 68 [controller release]; |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace | 71 } // namespace |
| 71 | 72 |
| OLD | NEW |