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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/devtools/devtools_window_testing.h" | 10 #include "chrome/browser/devtools/devtools_window_testing.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "components/bookmarks/test/bookmark_test_helpers.h" | 21 #include "components/bookmarks/test/bookmark_test_helpers.h" |
22 #include "extensions/common/switches.h" | 22 #include "extensions/common/switches.h" |
23 | 23 |
24 using content::OpenURLParams; | 24 using content::OpenURLParams; |
25 using content::Referrer; | 25 using content::Referrer; |
26 | 26 |
27 // Basic sanity check of ViewID use on the mac. | 27 // Basic sanity check of ViewID use on the mac. |
28 class ViewIDTest : public InProcessBrowserTest { | 28 class ViewIDTest : public InProcessBrowserTest { |
29 public: | 29 public: |
30 ViewIDTest() : root_window_(nil) { | 30 ViewIDTest() : root_window_(nil) { |
31 CommandLine::ForCurrentProcess()->AppendSwitch( | 31 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
32 extensions::switches::kEnableExperimentalExtensionApis); | 32 extensions::switches::kEnableExperimentalExtensionApis); |
33 } | 33 } |
34 | 34 |
35 void CheckViewID(ViewID view_id, bool should_have) { | 35 void CheckViewID(ViewID view_id, bool should_have) { |
36 if (!root_window_) | 36 if (!root_window_) |
37 root_window_ = browser()->window()->GetNativeWindow(); | 37 root_window_ = browser()->window()->GetNativeWindow(); |
38 | 38 |
39 ASSERT_TRUE(root_window_); | 39 ASSERT_TRUE(root_window_); |
40 NSView* view = view_id_util::GetView(root_window_, view_id); | 40 NSView* view = view_id_util::GetView(root_window_, view_id); |
41 EXPECT_EQ(should_have, !!view) << " Failed id=" << view_id; | 41 EXPECT_EQ(should_have, !!view) << " Failed id=" << view_id; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 // Open the 11th tab. | 122 // Open the 11th tab. |
123 browser()->OpenURL(OpenURLParams(GURL(url::kAboutBlankURL), | 123 browser()->OpenURL(OpenURLParams(GURL(url::kAboutBlankURL), |
124 Referrer(), | 124 Referrer(), |
125 NEW_BACKGROUND_TAB, | 125 NEW_BACKGROUND_TAB, |
126 ui::PAGE_TRANSITION_TYPED, | 126 ui::PAGE_TRANSITION_TYPED, |
127 false)); | 127 false)); |
128 CheckViewID(VIEW_ID_TAB_LAST, true); | 128 CheckViewID(VIEW_ID_TAB_LAST, true); |
129 } | 129 } |
OLD | NEW |