OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <oleacc.h> | 5 #include <oleacc.h> |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 // Check button and its Name, Role, State. | 127 // Check button and its Name, Role, State. |
128 EXPECT_EQ(l10n_util::GetString(IDS_ACCNAME_BACK), GetName(acc_obj)); | 128 EXPECT_EQ(l10n_util::GetString(IDS_ACCNAME_BACK), GetName(acc_obj)); |
129 EXPECT_EQ(ROLE_SYSTEM_BUTTONDROPDOWN, GetRole(acc_obj)); | 129 EXPECT_EQ(ROLE_SYSTEM_BUTTONDROPDOWN, GetRole(acc_obj)); |
130 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | | 130 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | |
131 STATE_SYSTEM_FOCUSABLE | | 131 STATE_SYSTEM_FOCUSABLE | |
132 STATE_SYSTEM_UNAVAILABLE, | 132 STATE_SYSTEM_UNAVAILABLE, |
133 GetState(acc_obj)); | 133 GetState(acc_obj)); |
134 | 134 |
135 // Now check Back status in different situations. | 135 // Now check Back status in different situations. |
136 scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 136 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
137 ASSERT_TRUE(window.get()); | 137 ASSERT_TRUE(window.get()); |
138 int tab_count = -1; | 138 int tab_count = -1; |
139 | 139 |
140 // Set URL and check button status. | 140 // Set URL and check button status. |
141 scoped_ptr<TabProxy> tab1(window->GetTab(0)); | 141 scoped_refptr<TabProxy> tab1(window->GetTab(0)); |
142 ASSERT_TRUE(tab1.get()); | 142 ASSERT_TRUE(tab1.get()); |
143 FilePath test_file1(test_data_directory_); | 143 FilePath test_file1(test_data_directory_); |
144 test_file1 = test_file1.AppendASCII("title1.html"); | 144 test_file1 = test_file1.AppendASCII("title1.html"); |
145 tab1->NavigateToURL(net::FilePathToFileURL(test_file1)); | 145 tab1->NavigateToURL(net::FilePathToFileURL(test_file1)); |
146 Sleep(sleep_timeout_ms()); | 146 Sleep(sleep_timeout_ms()); |
147 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | STATE_SYSTEM_FOCUSABLE, | 147 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | STATE_SYSTEM_FOCUSABLE, |
148 GetState(acc_obj)); | 148 GetState(acc_obj)); |
149 // Go Back and check status. | 149 // Go Back and check status. |
150 window->ApplyAccelerator(IDC_BACK); | 150 window->ApplyAccelerator(IDC_BACK); |
151 Sleep(sleep_timeout_ms()); | 151 Sleep(sleep_timeout_ms()); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | | 228 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | |
229 STATE_SYSTEM_FOCUSABLE | | 229 STATE_SYSTEM_FOCUSABLE | |
230 STATE_SYSTEM_UNAVAILABLE, | 230 STATE_SYSTEM_UNAVAILABLE, |
231 GetState(acc_obj)); | 231 GetState(acc_obj)); |
232 } else { | 232 } else { |
233 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_UNAVAILABLE, | 233 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_UNAVAILABLE, |
234 GetState(acc_obj)); | 234 GetState(acc_obj)); |
235 } | 235 } |
236 | 236 |
237 // Now check Back status in different situations. | 237 // Now check Back status in different situations. |
238 scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 238 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
239 ASSERT_TRUE(window.get()); | 239 ASSERT_TRUE(window.get()); |
240 int tab_count = -1; | 240 int tab_count = -1; |
241 | 241 |
242 // Set URL and check button status. | 242 // Set URL and check button status. |
243 scoped_ptr<TabProxy> tab1(window->GetTab(0)); | 243 scoped_refptr<TabProxy> tab1(window->GetTab(0)); |
244 ASSERT_TRUE(tab1.get()); | 244 ASSERT_TRUE(tab1.get()); |
245 FilePath test_file1(test_data_directory_); | 245 FilePath test_file1(test_data_directory_); |
246 test_file1 = test_file1.AppendASCII("title1.html"); | 246 test_file1 = test_file1.AppendASCII("title1.html"); |
247 tab1->NavigateToURL(net::FilePathToFileURL(test_file1)); | 247 tab1->NavigateToURL(net::FilePathToFileURL(test_file1)); |
248 Sleep(sleep_timeout_ms()); | 248 Sleep(sleep_timeout_ms()); |
249 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | | 249 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | |
250 STATE_SYSTEM_FOCUSABLE | | 250 STATE_SYSTEM_FOCUSABLE | |
251 STATE_SYSTEM_UNAVAILABLE, | 251 STATE_SYSTEM_UNAVAILABLE, |
252 GetState(acc_obj)); | 252 GetState(acc_obj)); |
253 // Go Back and check status. | 253 // Go Back and check status. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 hr = GetStarButton(&acc_obj); | 315 hr = GetStarButton(&acc_obj); |
316 ASSERT_TRUE(S_OK == hr); | 316 ASSERT_TRUE(S_OK == hr); |
317 ASSERT_TRUE(NULL != acc_obj); | 317 ASSERT_TRUE(NULL != acc_obj); |
318 | 318 |
319 // Check button and its Name, Role, State. | 319 // Check button and its Name, Role, State. |
320 EXPECT_EQ(l10n_util::GetString(IDS_ACCNAME_STAR), GetName(acc_obj)); | 320 EXPECT_EQ(l10n_util::GetString(IDS_ACCNAME_STAR), GetName(acc_obj)); |
321 EXPECT_EQ(ROLE_SYSTEM_PUSHBUTTON, GetRole(acc_obj)); | 321 EXPECT_EQ(ROLE_SYSTEM_PUSHBUTTON, GetRole(acc_obj)); |
322 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE, GetState(acc_obj)); | 322 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE, GetState(acc_obj)); |
323 | 323 |
324 // Now, check Star status in different situations. | 324 // Now, check Star status in different situations. |
325 scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 325 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
326 ASSERT_TRUE(window.get()); | 326 ASSERT_TRUE(window.get()); |
327 | 327 |
328 // Set URL and check button status. | 328 // Set URL and check button status. |
329 scoped_ptr<TabProxy> tab1(window->GetTab(0)); | 329 scoped_refptr<TabProxy> tab1(window->GetTab(0)); |
330 ASSERT_TRUE(tab1.get()); | 330 ASSERT_TRUE(tab1.get()); |
331 FilePath test_file1(test_data_directory_); | 331 FilePath test_file1(test_data_directory_); |
332 test_file1 = test_file1.AppendASCII("title1.html"); | 332 test_file1 = test_file1.AppendASCII("title1.html"); |
333 tab1->NavigateToURL(net::FilePathToFileURL(test_file1)); | 333 tab1->NavigateToURL(net::FilePathToFileURL(test_file1)); |
334 Sleep(sleep_timeout_ms()); | 334 Sleep(sleep_timeout_ms()); |
335 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE, GetState(acc_obj)); | 335 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE, GetState(acc_obj)); |
336 | 336 |
337 // Add empty new tab and check status. | 337 // Add empty new tab and check status. |
338 int tab_count = -1; | 338 int tab_count = -1; |
339 ASSERT_TRUE(window->GetTabCount(&tab_count)); | 339 ASSERT_TRUE(window->GetTabCount(&tab_count)); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 // State "has popup" only supported in XP and higher. | 416 // State "has popup" only supported in XP and higher. |
417 if (win_util::GetWinVersion() > win_util::WINVERSION_2000) { | 417 if (win_util::GetWinVersion() > win_util::WINVERSION_2000) { |
418 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | STATE_SYSTEM_FOCUSABLE, | 418 EXPECT_EQ(STATE_SYSTEM_HASPOPUP | STATE_SYSTEM_FOCUSABLE, |
419 GetState(acc_obj)); | 419 GetState(acc_obj)); |
420 } else { | 420 } else { |
421 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE, GetState(acc_obj)); | 421 EXPECT_EQ(STATE_SYSTEM_FOCUSABLE, GetState(acc_obj)); |
422 } | 422 } |
423 | 423 |
424 CHK_RELEASE(acc_obj); | 424 CHK_RELEASE(acc_obj); |
425 } | 425 } |
OLD | NEW |