| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_utils.h" | 9 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 10 #include "chrome/browser/download/download_shelf.h" | 10 #include "chrome/browser/download/download_shelf.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Basic sanity check of ViewID use on the mac. | 26 // Basic sanity check of ViewID use on the mac. |
| 27 class ViewIDTest : public InProcessBrowserTest { | 27 class ViewIDTest : public InProcessBrowserTest { |
| 28 public: | 28 public: |
| 29 ViewIDTest() : root_window_(nil) { | 29 ViewIDTest() : root_window_(nil) { |
| 30 CommandLine::ForCurrentProcess()->AppendSwitch( | 30 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 31 switches::kEnableExperimentalExtensionApis); | 31 switches::kEnableExperimentalExtensionApis); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void CheckViewID(ViewID view_id, bool should_have) { | 34 void CheckViewID(ViewID view_id, bool should_have) { |
| 35 if (!root_window_) | 35 if (!root_window_) |
| 36 root_window_ = browser()->window()->GetNativeHandle(); | 36 root_window_ = browser()->window()->GetNativeWindow(); |
| 37 | 37 |
| 38 ASSERT_TRUE(root_window_); | 38 ASSERT_TRUE(root_window_); |
| 39 NSView* view = view_id_util::GetView(root_window_, view_id); | 39 NSView* view = view_id_util::GetView(root_window_, view_id); |
| 40 EXPECT_EQ(should_have, !!view) << " Failed id=" << view_id; | 40 EXPECT_EQ(should_have, !!view) << " Failed id=" << view_id; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void DoTest() { | 43 void DoTest() { |
| 44 // Make sure FindBar is created to test | 44 // Make sure FindBar is created to test |
| 45 // VIEW_ID_FIND_IN_PAGE_TEXT_FIELD and VIEW_ID_FIND_IN_PAGE. | 45 // VIEW_ID_FIND_IN_PAGE_TEXT_FIELD and VIEW_ID_FIND_IN_PAGE. |
| 46 browser()->ShowFindBar(); | 46 browser()->ShowFindBar(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // VIEW_ID_TAB_LAST should always be available. | 111 // VIEW_ID_TAB_LAST should always be available. |
| 112 CheckViewID(VIEW_ID_TAB_LAST, true); | 112 CheckViewID(VIEW_ID_TAB_LAST, true); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // Open the 11th tab. | 115 // Open the 11th tab. |
| 116 browser()->OpenURL(OpenURLParams( | 116 browser()->OpenURL(OpenURLParams( |
| 117 GURL(chrome::kAboutBlankURL), Referrer(), NEW_BACKGROUND_TAB, | 117 GURL(chrome::kAboutBlankURL), Referrer(), NEW_BACKGROUND_TAB, |
| 118 content::PAGE_TRANSITION_TYPED, false)); | 118 content::PAGE_TRANSITION_TYPED, false)); |
| 119 CheckViewID(VIEW_ID_TAB_LAST, true); | 119 CheckViewID(VIEW_ID_TAB_LAST, true); |
| 120 } | 120 } |
| OLD | NEW |