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

Side by Side Diff: ppapi/shared_impl/var_tracker_unittest.cc

Issue 630883002: replace OVERRIDE and FINAL with override and final in ppapi/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « ppapi/shared_impl/var.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "ppapi/shared_impl/proxy_lock.h" 8 #include "ppapi/shared_impl/proxy_lock.h"
9 #include "ppapi/shared_impl/var.h" 9 #include "ppapi/shared_impl/var.h"
10 #include "ppapi/shared_impl/var_tracker.h" 10 #include "ppapi/shared_impl/var_tracker.h"
(...skipping 11 matching lines...) Expand all
22 mock_var_alive_count++; 22 mock_var_alive_count++;
23 } 23 }
24 virtual ~MockStringVar() { mock_var_alive_count--; } 24 virtual ~MockStringVar() { mock_var_alive_count--; }
25 bool HasValidVarID() { return GetExistingVarID() != 0; } 25 bool HasValidVarID() { return GetExistingVarID() != 0; }
26 }; 26 };
27 27
28 class MockObjectVar : public Var { 28 class MockObjectVar : public Var {
29 public: 29 public:
30 MockObjectVar() : Var() { mock_var_alive_count++; } 30 MockObjectVar() : Var() { mock_var_alive_count++; }
31 virtual ~MockObjectVar() { mock_var_alive_count--; } 31 virtual ~MockObjectVar() { mock_var_alive_count--; }
32 virtual PP_VarType GetType() const OVERRIDE { return PP_VARTYPE_OBJECT; } 32 virtual PP_VarType GetType() const override { return PP_VARTYPE_OBJECT; }
33 bool HasValidVarID() { return GetExistingVarID() != 0; } 33 bool HasValidVarID() { return GetExistingVarID() != 0; }
34 }; 34 };
35 35
36 } // namespace 36 } // namespace
37 37
38 class VarTrackerTest : public testing::Test { 38 class VarTrackerTest : public testing::Test {
39 public: 39 public:
40 VarTrackerTest() {} 40 VarTrackerTest() {}
41 41
42 // Test implementation. 42 // Test implementation.
43 virtual void SetUp() OVERRIDE { 43 virtual void SetUp() override {
44 ASSERT_EQ(0, mock_var_alive_count); 44 ASSERT_EQ(0, mock_var_alive_count);
45 ProxyLock::EnableLockingOnThreadForTest(); 45 ProxyLock::EnableLockingOnThreadForTest();
46 } 46 }
47 virtual void TearDown() OVERRIDE {} 47 virtual void TearDown() override {}
48 48
49 VarTracker& var_tracker() { return *globals_.GetVarTracker(); } 49 VarTracker& var_tracker() { return *globals_.GetVarTracker(); }
50 50
51 private: 51 private:
52 TestGlobals globals_; 52 TestGlobals globals_;
53 }; 53 };
54 54
55 // Test that ResetVarID is called when the last PP_Var ref was deleted but the 55 // Test that ResetVarID is called when the last PP_Var ref was deleted but the
56 // object lives on. 56 // object lives on.
57 TEST_F(VarTrackerTest, LastResourceRef) { 57 TEST_F(VarTrackerTest, LastResourceRef) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 another_var = NULL; 143 another_var = NULL;
144 EXPECT_TRUE(var_tracker().GetVar(pp_var)); 144 EXPECT_TRUE(var_tracker().GetVar(pp_var));
145 EXPECT_EQ(1, mock_var_alive_count); 145 EXPECT_EQ(1, mock_var_alive_count);
146 146
147 // Releasing plugin reference. 147 // Releasing plugin reference.
148 EXPECT_TRUE(var_tracker().ReleaseVar(pp_var)); 148 EXPECT_TRUE(var_tracker().ReleaseVar(pp_var));
149 EXPECT_EQ(0, mock_var_alive_count); 149 EXPECT_EQ(0, mock_var_alive_count);
150 } 150 }
151 151
152 } // namespace ppapi 152 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/var.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698