| Index: cc/trees/layer_tree_host_unittest.cc | 
| diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc | 
| index 4efbb6872ae2a022a31671e0b71ae87a8d660eab..5f212536f20798faa8c3b0b2c0eb6bd074dd9a84 100644 | 
| --- a/cc/trees/layer_tree_host_unittest.cc | 
| +++ b/cc/trees/layer_tree_host_unittest.cc | 
| @@ -450,13 +450,13 @@ class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest { | 
| // Ensure that our mock calls execute in sequence. | 
| ::testing::InSequence s; | 
|  | 
| -    // At init, visibility is set to true and we will call | 
| -    // SetAggressivelyFreeResources(false). | 
| -    EXPECT_CALL(*mock_context_support_ptr_, SetClientVisible(0, true)); | 
| +    // At init, visibility is set to true. | 
| +    EXPECT_CALL(*mock_context_support_ptr_, ClientBecameVisible()) | 
| +        .WillOnce( | 
| +            ::testing::Invoke(mock_context_support_ptr_, | 
| +                              &MockContextSupport::SuperClientBecameVisible)); | 
| EXPECT_CALL(*mock_context_support_ptr_, AnyClientsVisible()) | 
| .WillOnce(::testing::Return(true)); | 
| -    EXPECT_CALL(*mock_context_support_ptr_, | 
| -                SetAggressivelyFreeResources(false)); | 
|  | 
| return LayerTreeHostTest::CreateDelegatingOutputSurface( | 
| std::move(compositor_context_provider), | 
| @@ -478,13 +478,15 @@ class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest { | 
| ::testing::InSequence s; | 
|  | 
| // While running, visibility is set to false, and we will call | 
| -    // DeleteCachedResources and SetAggressivelyFreeResources(true). | 
| -    EXPECT_CALL(*mock_context_support_ptr_, SetClientVisible(0, false)); | 
| +    // DeleteCachedResources. | 
| +    EXPECT_CALL(*mock_context_support_ptr_, ClientBecameNotVisible_(_)) | 
| +        .WillOnce(::testing::Invoke( | 
| +            mock_context_support_ptr_, | 
| +            &MockContextSupport::SuperClientBecameNotVisible)); | 
| EXPECT_CALL(*mock_context_support_ptr_, AnyClientsVisible()) | 
| .WillOnce(::testing::Return(false)); | 
| -    EXPECT_CALL(*mock_context_provider_ptr_, DeleteCachedResources()); | 
| -    EXPECT_CALL(*mock_context_support_ptr_, SetAggressivelyFreeResources(true)) | 
| -        .WillOnce(testing::Invoke([this](bool is_visible) { EndTest(); })); | 
| +    EXPECT_CALL(*mock_context_provider_ptr_, DeleteCachedResources()) | 
| +        .WillOnce(testing::Invoke([this]() { EndTest(); })); | 
| } | 
|  | 
| void AfterTest() override { | 
| @@ -509,11 +511,25 @@ class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest { | 
|  | 
| class MockContextSupport : public TestContextSupport { | 
| public: | 
| +    using VisibilityToken = std::unique_ptr<ScopedVisibility>; | 
| MockContextSupport() {} | 
| -    MOCK_METHOD1(SetAggressivelyFreeResources, | 
| -                 void(bool aggressively_free_resources)); | 
| -    MOCK_METHOD2(SetClientVisible, void(int client_id, bool is_visible)); | 
| +    MOCK_METHOD0(ClientBecameVisible, VisibilityToken()); | 
| +    MOCK_METHOD1(ClientBecameNotVisible_, | 
| +                 void(VisibilityToken& visibility));  // NOLINT | 
| MOCK_CONST_METHOD0(AnyClientsVisible, bool()); | 
| + | 
| +    // Wrapper to allow mocking w/ move-only type. | 
| +    void ClientBecameNotVisible(VisibilityToken visibility) override { | 
| +      ClientBecameNotVisible_(visibility); | 
| +    } | 
| + | 
| +    // Wrappers to allow forwarding to super class implementation. | 
| +    void SuperClientBecameNotVisible(VisibilityToken& visibility) {  // NOLINT | 
| +      TestContextSupport::ClientBecameNotVisible(std::move(visibility)); | 
| +    } | 
| +    VisibilityToken SuperClientBecameVisible() { | 
| +      return TestContextSupport::ClientBecameVisible(); | 
| +    } | 
| }; | 
|  | 
| MockContextSupport* mock_context_support_ptr_; | 
|  |