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 3 // found in the LICENSE file. 4 5 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" 6 7 #include "chrome/browser/sync/test/integration/sync_test.h" 8 9 namespace { 10 11 // The SyncTest instance associated with sync_datatype_helper. 12 static SyncTest* test = NULL; 13 14 } // namespace 15 16 namespace sync_datatype_helper { 17 18 void AssociateWithTest(SyncTest* test) { 19 ASSERT_TRUE(test != NULL) << "Cannot associate with null test."; 20 ASSERT_TRUE(::test == NULL) << "Already associated with a test."; 21 ::test = test; 22 } 23 24 SyncTest* test() { 25 EXPECT_TRUE(::test != NULL) << "Must call AssociateWithTest first."; 26 return ::test; 27 } 28 29 } // namespace sync_datatype_helper 30