OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/win/scoped_bstr.h" | 8 #include "base/win/scoped_bstr.h" |
9 #include "base/win/scoped_com_initializer.h" | 9 #include "base/win/scoped_com_initializer.h" |
10 #include "base/win/scoped_comptr.h" | 10 #include "base/win/scoped_comptr.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 monitor.WaitForNextEvent(&event, &hwnd, &role, &state, &name); | 231 monitor.WaitForNextEvent(&event, &hwnd, &role, &state, &name); |
232 | 232 |
233 LOG(INFO) << "Got event: " | 233 LOG(INFO) << "Got event: " |
234 << " event=" << event | 234 << " event=" << event |
235 << " hwnd=" << hwnd | 235 << " hwnd=" << hwnd |
236 << " role=" << role | 236 << " role=" << role |
237 << " state=" << state | 237 << " state=" << state |
238 << " name=" << name; | 238 << " name=" << name; |
239 | 239 |
240 // We should get only focus events. | 240 // We should get only focus events. |
241 EXPECT_EQ(EVENT_OBJECT_FOCUS, event); | 241 EXPECT_EQ(static_cast<DWORD>(EVENT_OBJECT_FOCUS), event); |
242 | 242 |
243 // We should get only focus events on document objects. (On a page with | 243 // We should get only focus events on document objects. (On a page with |
244 // JavaScript or autofocus, additional focus events would be expected.) | 244 // JavaScript or autofocus, additional focus events would be expected.) |
245 EXPECT_EQ(ROLE_SYSTEM_DOCUMENT, role); | 245 EXPECT_EQ(static_cast<DWORD>(ROLE_SYSTEM_DOCUMENT), role); |
246 | 246 |
247 // We shouldn't get any events on the first page because from the time | 247 // We shouldn't get any events on the first page because from the time |
248 // we start monitoring, the user has already initiated a load to the | 248 // we start monitoring, the user has already initiated a load to the |
249 // second page. | 249 // second page. |
250 EXPECT_NE("First Page", name); | 250 EXPECT_NE("First Page", name); |
251 | 251 |
252 // Finish when we get an event on the second page. | 252 // Finish when we get an event on the second page. |
253 if (name == "This page is in English") { | 253 if (name == "This page is in English") { |
254 LOG(INFO) << "Got event on second page, finishing test."; | 254 LOG(INFO) << "Got event on second page, finishing test."; |
255 break; | 255 break; |
256 } | 256 } |
257 } | 257 } |
258 } | 258 } |
OLD | NEW |