| 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 "chrome/browser/ui/views/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 bool found_app_menu = false; | 50 bool found_app_menu = false; |
| 51 const views::View* view = NULL; | 51 const views::View* view = NULL; |
| 52 while (view != first_view) { | 52 while (view != first_view) { |
| 53 focus_manager->AdvanceFocus(false); | 53 focus_manager->AdvanceFocus(false); |
| 54 view = focus_manager->GetFocusedView(); | 54 view = focus_manager->GetFocusedView(); |
| 55 ids.push_back(view->id()); | 55 ids.push_back(view->id()); |
| 56 if (view->id() == VIEW_ID_RELOAD_BUTTON) | 56 if (view->id() == VIEW_ID_RELOAD_BUTTON) |
| 57 found_reload = true; | 57 found_reload = true; |
| 58 if (view->id() == VIEW_ID_APP_MENU) | 58 if (view->id() == VIEW_ID_APP_MENU) |
| 59 found_app_menu = true; | 59 found_app_menu = true; |
| 60 if (view->id() == VIEW_ID_LOCATION_BAR || view->id() == VIEW_ID_OMNIBOX) | 60 if (view->id() == VIEW_ID_OMNIBOX) |
| 61 found_location_bar = true; | 61 found_location_bar = true; |
| 62 if (ids.size() > 100) | 62 if (ids.size() > 100) |
| 63 GTEST_FAIL() << "Tabbed 100 times, still haven't cycled back!"; | 63 GTEST_FAIL() << "Tabbed 100 times, still haven't cycled back!"; |
| 64 } | 64 } |
| 65 | 65 |
| 66 // Make sure we found a few key items. | 66 // Make sure we found a few key items. |
| 67 ASSERT_TRUE(found_reload); | 67 ASSERT_TRUE(found_reload); |
| 68 ASSERT_TRUE(found_app_menu); | 68 ASSERT_TRUE(found_app_menu); |
| 69 ASSERT_TRUE(found_location_bar); | 69 ASSERT_TRUE(found_location_bar); |
| 70 | 70 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 model, GURL("http://foo.com"), ASCIIToUTF16("Foo")); | 112 model, GURL("http://foo.com"), ASCIIToUTF16("Foo")); |
| 113 | 113 |
| 114 // We want to specifically test the case where the bookmark bar is | 114 // We want to specifically test the case where the bookmark bar is |
| 115 // already showing when a window opens, so create a second browser | 115 // already showing when a window opens, so create a second browser |
| 116 // window with the same profile. | 116 // window with the same profile. |
| 117 Browser* second_browser = CreateBrowser(browser()->profile()); | 117 Browser* second_browser = CreateBrowser(browser()->profile()); |
| 118 RunToolbarCycleFocusTest(second_browser); | 118 RunToolbarCycleFocusTest(second_browser); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace | 121 } // namespace |
| OLD | NEW |