Created
July 16, 2012 21:30
-
-
Save chebert/3125188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TEST(PerformanceMonitorDatabaseSetupTest, | |
| ActiveIntervalRetrievalDuringActiveInterval) { | |
| FilePath alternate_path; | |
| file_util::CreateNewTempDirectory(FilePath::StringType(), &alternate_path); | |
| TestingClock* clock = new TestingClock(); | |
| scoped_ptr<Database> db = Database::Create(alternate_path); | |
| db->set_clock(scoped_ptr<Database::Clock>(clock)); | |
| db->AddStateValue("test", "test"); //1 | |
| base::Time start_time = clock->GetTime(); //2 | |
| db->AddStateValue("test", "test"); //3 | |
| base::Time end_time = clock->GetTime(); //4 | |
| db->AddStateValue("test", "test"); //5 | |
| std::vector<TimeRange> active_interval = db->GetActiveIntervals(start_time, | |
| end_time); | |
| ASSERT_EQ(active_interval.size(), 1u); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment