Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: content/browser/accessibility/accessibility_win_browsertest.cc

Issue 2792383003: Rename ScopedComPtr::Release() to ScopedComPtr::Reset() (Closed)
Patch Set: Fix New Callers Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1983 EXPECT_HRESULT_SUCCEEDED(cell1->role(&role)); 1983 EXPECT_HRESULT_SUCCEEDED(cell1->role(&role));
1984 EXPECT_EQ(ROLE_SYSTEM_CELL, role); 1984 EXPECT_EQ(ROLE_SYSTEM_CELL, role);
1985 EXPECT_HRESULT_SUCCEEDED(cell1->get_accName(childid_self, name.Receive())); 1985 EXPECT_HRESULT_SUCCEEDED(cell1->get_accName(childid_self, name.Receive()));
1986 // EXPECT_STREQ(L"AD", name); 1986 // EXPECT_STREQ(L"AD", name);
1987 EXPECT_HRESULT_SUCCEEDED(cell1.QueryInterface(accessible_cell.Receive())); 1987 EXPECT_HRESULT_SUCCEEDED(cell1.QueryInterface(accessible_cell.Receive()));
1988 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index)); 1988 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index));
1989 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index)); 1989 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index));
1990 EXPECT_EQ(0, row_index); 1990 EXPECT_EQ(0, row_index);
1991 EXPECT_EQ(0, column_index); 1991 EXPECT_EQ(0, column_index);
1992 name.Reset(); 1992 name.Reset();
1993 accessible_cell.Release(); 1993 accessible_cell.Reset();
1994 1994
1995 // The first cell has a rowspan of 2, try navigating down and expect to get 1995 // The first cell has a rowspan of 2, try navigating down and expect to get
1996 // at the end of the table. 1996 // at the end of the table.
1997 base::win::ScopedVariant variant; 1997 base::win::ScopedVariant variant;
1998 EXPECT_HRESULT_SUCCEEDED( 1998 EXPECT_HRESULT_SUCCEEDED(
1999 cell1->accNavigate(NAVDIR_DOWN, childid_self, variant.Receive())); 1999 cell1->accNavigate(NAVDIR_DOWN, childid_self, variant.Receive()));
2000 ASSERT_EQ(VT_EMPTY, variant.type()); 2000 ASSERT_EQ(VT_EMPTY, variant.type());
2001 2001
2002 // Try navigating to the cell in the first row, 2nd column. 2002 // Try navigating to the cell in the first row, 2nd column.
2003 base::win::ScopedComPtr<IAccessible2> cell2; 2003 base::win::ScopedComPtr<IAccessible2> cell2;
2004 EXPECT_HRESULT_SUCCEEDED( 2004 EXPECT_HRESULT_SUCCEEDED(
2005 cell1->accNavigate(NAVDIR_RIGHT, childid_self, variant.Receive())); 2005 cell1->accNavigate(NAVDIR_RIGHT, childid_self, variant.Receive()));
2006 ASSERT_NE(nullptr, V_DISPATCH(variant.AsInput())); 2006 ASSERT_NE(nullptr, V_DISPATCH(variant.AsInput()));
2007 ASSERT_EQ(VT_DISPATCH, variant.type()); 2007 ASSERT_EQ(VT_DISPATCH, variant.type());
2008 V_DISPATCH(variant.AsInput())->QueryInterface(cell2.Receive()); 2008 V_DISPATCH(variant.AsInput())->QueryInterface(cell2.Receive());
2009 EXPECT_HRESULT_SUCCEEDED(cell2->role(&role)); 2009 EXPECT_HRESULT_SUCCEEDED(cell2->role(&role));
2010 EXPECT_EQ(ROLE_SYSTEM_CELL, role); 2010 EXPECT_EQ(ROLE_SYSTEM_CELL, role);
2011 EXPECT_HRESULT_SUCCEEDED(cell2->get_accName(childid_self, name.Receive())); 2011 EXPECT_HRESULT_SUCCEEDED(cell2->get_accName(childid_self, name.Receive()));
2012 // EXPECT_STREQ(L"BC", name); 2012 // EXPECT_STREQ(L"BC", name);
2013 EXPECT_HRESULT_SUCCEEDED(cell2.QueryInterface(accessible_cell.Receive())); 2013 EXPECT_HRESULT_SUCCEEDED(cell2.QueryInterface(accessible_cell.Receive()));
2014 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index)); 2014 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index));
2015 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index)); 2015 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index));
2016 EXPECT_EQ(0, row_index); 2016 EXPECT_EQ(0, row_index);
2017 EXPECT_EQ(1, column_index); 2017 EXPECT_EQ(1, column_index);
2018 variant.Reset(); 2018 variant.Reset();
2019 name.Reset(); 2019 name.Reset();
2020 accessible_cell.Release(); 2020 accessible_cell.Reset();
2021 2021
2022 // Try navigating to the cell in the second row, 2nd column. 2022 // Try navigating to the cell in the second row, 2nd column.
2023 base::win::ScopedComPtr<IAccessible2> cell3; 2023 base::win::ScopedComPtr<IAccessible2> cell3;
2024 EXPECT_HRESULT_SUCCEEDED( 2024 EXPECT_HRESULT_SUCCEEDED(
2025 cell2->accNavigate(NAVDIR_DOWN, childid_self, variant.Receive())); 2025 cell2->accNavigate(NAVDIR_DOWN, childid_self, variant.Receive()));
2026 ASSERT_NE(nullptr, V_DISPATCH(variant.AsInput())); 2026 ASSERT_NE(nullptr, V_DISPATCH(variant.AsInput()));
2027 ASSERT_EQ(VT_DISPATCH, variant.type()); 2027 ASSERT_EQ(VT_DISPATCH, variant.type());
2028 V_DISPATCH(variant.AsInput())->QueryInterface(cell3.Receive()); 2028 V_DISPATCH(variant.AsInput())->QueryInterface(cell3.Receive());
2029 EXPECT_HRESULT_SUCCEEDED(cell3->role(&role)); 2029 EXPECT_HRESULT_SUCCEEDED(cell3->role(&role));
2030 EXPECT_EQ(ROLE_SYSTEM_CELL, role); 2030 EXPECT_EQ(ROLE_SYSTEM_CELL, role);
2031 EXPECT_HRESULT_SUCCEEDED(cell3->get_accName(childid_self, name.Receive())); 2031 EXPECT_HRESULT_SUCCEEDED(cell3->get_accName(childid_self, name.Receive()));
2032 // EXPECT_STREQ(L"EF", name); 2032 // EXPECT_STREQ(L"EF", name);
2033 EXPECT_HRESULT_SUCCEEDED(cell3.QueryInterface(accessible_cell.Receive())); 2033 EXPECT_HRESULT_SUCCEEDED(cell3.QueryInterface(accessible_cell.Receive()));
2034 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index)); 2034 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_rowIndex(&row_index));
2035 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index)); 2035 EXPECT_HRESULT_SUCCEEDED(accessible_cell->get_columnIndex(&column_index));
2036 EXPECT_EQ(1, row_index); 2036 EXPECT_EQ(1, row_index);
2037 EXPECT_EQ(1, column_index); 2037 EXPECT_EQ(1, column_index);
2038 variant.Reset(); 2038 variant.Reset();
2039 name.Reset(); 2039 name.Reset();
2040 accessible_cell.Release(); 2040 accessible_cell.Reset();
2041 } 2041 }
2042 2042
2043 } // namespace content 2043 } // namespace content
OLDNEW
« no previous file with comments | « chrome/utility/importer/ie_importer_win.cc ('k') | content/browser/accessibility/browser_accessibility_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698