コード例 #1
0
 def testGetWinNowFunction_QPC(self):
     if not (sys.platform.startswith(trace_time._PLATFORMS['windows'])
             or sys.platform.startswith(trace_time._PLATFORMS['cygwin'])):
         return True
     # Test requires QPC to be available on platform.
     if not trace_time.IsQPCUsable():
         return True
     self.assertGreater(trace_time.Now(), 0)
コード例 #2
0
    def testIsQPCUsable_returnsTrueOnWindows(self):
        if not (sys.platform.startswith(trace_time._PLATFORMS['windows'])
                or sys.platform.startswith(trace_time._PLATFORMS['cygwin'])):
            return True

        def Proc():
            return 'Intel64 Family 15 Model 23 Stepping 6, GenuineIntel'

        with self.ReplacePlatformProcessorCall(Proc):
            self.assertTrue(trace_time.IsQPCUsable())
コード例 #3
0
    def testIsQPCUsable_buggyAthlonProcReturnsFalse(self):
        if not (sys.platform.startswith(trace_time._PLATFORMS['windows'])
                or sys.platform.startswith(trace_time._PLATFORMS['cygwin'])):
            return True

        def BuggyAthlonProc():
            return 'AMD64 Family 15 Model 23 Stepping 6, AuthenticAMD'

        with self.ReplacePlatformProcessorCall(BuggyAthlonProc):
            self.assertFalse(trace_time.IsQPCUsable())