| 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 #include "chrome/browser/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 #include "chrome/browser/browser_window.h" | 6 #include "chrome/browser/browser_window.h" |
| 7 #include "chrome/browser/gtk/view_id_util.h" | 7 #include "chrome/browser/gtk/view_id_util.h" |
| 8 #include "chrome/common/url_constants.h" |
| 8 #include "chrome/test/in_process_browser_test.h" | 9 #include "chrome/test/in_process_browser_test.h" |
| 9 | 10 |
| 10 class ViewIDTest : public InProcessBrowserTest { | 11 class ViewIDTest : public InProcessBrowserTest { |
| 11 public: | 12 public: |
| 12 ViewIDTest() : root_window_(NULL) {} | 13 ViewIDTest() : root_window_(NULL) {} |
| 13 | 14 |
| 14 void CheckViewID(ViewID id, bool should_have) { | 15 void CheckViewID(ViewID id, bool should_have) { |
| 15 if (!root_window_) | 16 if (!root_window_) |
| 16 root_window_ = GTK_WIDGET(browser()->window()->GetNativeHandle()); | 17 root_window_ = GTK_WIDGET(browser()->window()->GetNativeHandle()); |
| 17 | 18 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 CheckViewID(static_cast<ViewID>(i), true); | 29 CheckViewID(static_cast<ViewID>(i), true); |
| 29 } | 30 } |
| 30 | 31 |
| 31 CheckViewID(VIEW_ID_PREDEFINED_COUNT, false); | 32 CheckViewID(VIEW_ID_PREDEFINED_COUNT, false); |
| 32 } | 33 } |
| 33 | 34 |
| 34 IN_PROC_BROWSER_TEST_F(ViewIDTest, Delegate) { | 35 IN_PROC_BROWSER_TEST_F(ViewIDTest, Delegate) { |
| 35 CheckViewID(VIEW_ID_TAB_0, true); | 36 CheckViewID(VIEW_ID_TAB_0, true); |
| 36 CheckViewID(VIEW_ID_TAB_1, false); | 37 CheckViewID(VIEW_ID_TAB_1, false); |
| 37 | 38 |
| 38 browser()->OpenURL(GURL("about:blank"), GURL(""), | 39 browser()->OpenURL(GURL(chrome::kAboutBlankURL), GURL(), |
| 39 NEW_BACKGROUND_TAB, PageTransition::TYPED); | 40 NEW_BACKGROUND_TAB, PageTransition::TYPED); |
| 40 | 41 |
| 41 CheckViewID(VIEW_ID_TAB_0, true); | 42 CheckViewID(VIEW_ID_TAB_0, true); |
| 42 CheckViewID(VIEW_ID_TAB_1, true); | 43 CheckViewID(VIEW_ID_TAB_1, true); |
| 43 } | 44 } |
| OLD | NEW |