| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/string16.h" | 7 #include "base/string16.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 class ActionBoxTest : public InProcessBrowserTest, | 30 class ActionBoxTest : public InProcessBrowserTest, |
| 31 public content::NotificationObserver { | 31 public content::NotificationObserver { |
| 32 protected: | 32 protected: |
| 33 ActionBoxTest() {} | 33 ActionBoxTest() {} |
| 34 | 34 |
| 35 virtual void SetUpOnMainThread() OVERRIDE { | 35 virtual void SetUpOnMainThread() OVERRIDE { |
| 36 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 36 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 37 ASSERT_NO_FATAL_FAILURE(SetupComponents()); | 37 ASSERT_NO_FATAL_FAILURE(SetupComponents()); |
| 38 chrome::FocusLocationBar(browser()); | 38 chrome::FocusLocationBar(browser()); |
| 39 // Use Textfield's view id on pure views. See crbug.com/71144. | 39 ASSERT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
| 40 ViewID location_bar_focus_view_id = VIEW_ID_LOCATION_BAR; | |
| 41 #if defined(USE_AURA) | |
| 42 location_bar_focus_view_id = VIEW_ID_OMNIBOX; | |
| 43 #endif | |
| 44 ASSERT_TRUE(ui_test_utils::IsViewFocused(browser(), | |
| 45 location_bar_focus_view_id)); | |
| 46 } | 40 } |
| 47 | 41 |
| 48 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 42 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 49 // Enable Action Box UI for the test. | 43 // Enable Action Box UI for the test. |
| 50 command_line->AppendSwitchASCII(switches::kActionBox, "1"); | 44 command_line->AppendSwitchASCII(switches::kActionBox, "1"); |
| 51 } | 45 } |
| 52 | 46 |
| 53 void SetupComponents() {} | 47 void SetupComponents() {} |
| 54 | 48 |
| 55 virtual void Observe(int type, | 49 virtual void Observe(int type, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // Page is now bookmarked. | 89 // Page is now bookmarked. |
| 96 ASSERT_TRUE(loc_bar->GetBookmarkStarVisibility()); | 90 ASSERT_TRUE(loc_bar->GetBookmarkStarVisibility()); |
| 97 | 91 |
| 98 // Get the BookmarkModel to unbookmark the bookmark. | 92 // Get the BookmarkModel to unbookmark the bookmark. |
| 99 bookmark_utils::RemoveAllBookmarks(model, GURL("http://www.google.com")); | 93 bookmark_utils::RemoveAllBookmarks(model, GURL("http://www.google.com")); |
| 100 | 94 |
| 101 // Page is now unbookmarked. | 95 // Page is now unbookmarked. |
| 102 ASSERT_FALSE(loc_bar->GetBookmarkStarVisibility()); | 96 ASSERT_FALSE(loc_bar->GetBookmarkStarVisibility()); |
| 103 | 97 |
| 104 } | 98 } |
| OLD | NEW |