日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > c/c++ >内容正文

c/c++

android封装多肽,深度探索C++对象模型之(四)...-Android.animation cts fail-Rails helper_169IT.COM...

發布時間:2025/4/16 c/c++ 56 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android封装多肽,深度探索C++对象模型之(四)...-Android.animation cts fail-Rails helper_169IT.COM... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

這兩天查cts 的fail, android.animation中有3個fail。

分別為testCurrentPlayTime,testCancel,testSetCurrentPlayTime,在此對著三個fail我的跟蹤解析情況做一說明。

1.??????testCancel:如前一封mail說的,是testCode本身有點問題,后來我改了testcode驗證:按照4.1的寫法,我寫了腳本跑整個包10遍,測了兩遍腳本,相當于20遍,未重現。注:按ICS的testcode,跑完10遍這個會fail2~3遍的。

2.??????testCurrentPlayTime:其測試用例如下:

public void testCurrentPlayTime()throws Throwable {

startAnimation(mValueAnimator);

Thread.sleep(200);

這里的值原來是100,我改成了200進行測試,也是用剛才的腳本共跑了20遍未出錯。

long currentPlayTime = mValueAnimator.getCurrentPlayTime();

assertTrue(currentPlayTime? >? 0);

}

我簡單說明為什么我把上面的100改成了200就ok了。因為startAnimation(mValueAnimator);會在UI線程去調用\framework\base\core\java\android\animation\ValueAnimator.java中的start函數,這個函數會進行一系列的處理,包括發送消息出去等。

mValueAnimator.getCurrentPlayTime();這個函數如下:?? ?public long getCurrentPlayTime() {

if(!mInitialized) Log.d(TAG,"mInitialized is false!!!");

if(mPlayingState ==STOPPED) Log.d(TAG, "mPlayingState == STOPPED!!!");

if (!mInitialized || mPlayingState ==STOPPED) {

Log.d(TAG,"getCurrentPlayTime");

return 0;

}

longcurrentTime=AnimationUtils.currentAnimationTimeMillis();

Log.d(TAG,"getCurrentPlayTime,currentTime is "+currentTime);

return currentTime - mStartTime;

}

其中的mPlayingState如果是STOPPED的話,就會返回0.而這個mPlayingState的初始值是STOPPED,是在上面所說的start函數中會發消息出去,然后有handler去處理。如果在100ms內處理的話,就不會fail,但是若getCurrentPlayTime在處理完之前調用,就會得到0,所以就fail。

錯誤時打的log:(getCurrentPlayTime在handleMessage之前)

D/ValueAnimator( 3336): ?animationHandler.sendEmptyMessage(ANIMATION_START)

D/ValueAnimator( 3336): Start the animation playing

D/ValueAnimator( 3336): ?This sets the initial value of the animation, prior to actually starting it running

D/ValueAnimator( 3336): mInitialized is false!!!

D/ValueAnimator( 3336): mPlayingState == STOPPED!!!

D/ValueAnimator( 3336): getCurrentPlayTime

D/ValueAnimator( 3336): setCurrentPlayTime!!!currentTime is 4215917

D/ValueAnimator( 3336): before animationFrame-----------mStartTime is 4215917

D/ValueAnimator( 3336): after animationFrame-----------mStartTime is 4215917

D/ValueAnimator( 3336): ?onAnimationStart

D/ValueAnimator( 3336): ?animationHandler.sendEmptyMessage(ANIMATION_START)

I/TAG ? ? ( 1828): sync time from stream----------------------@@@

D/ValueAnimator( 3336): mPlayingState == STOPPED!!!

D/ValueAnimator( 3336): getCurrentPlayTime

D/ValueAnimator( 3336): handleMessage:ANIMATION_START

D/ValueAnimator( 3336): startAnimation----Called internally to start an animation by adding it to the active animations list. Must be called on the UI thread

D/ValueAnimator( 3336): anim.startAnimation-----------

D/ValueAnimator( 3336): startAnimation----Called internally to start an animation by adding it to the active animations list. Must be called on the UI thread

D/ValueAnimator( 3336): anim.startAnimation-----------

D/ValueAnimator( 3336): handleMessage:ANIMATION_START

正確時打的log:(getCurrentPlayTime在handleMessage之后)

D/ValueAnimator( 3305): ?animationHandler.sendEmptyMessage(ANIMATION_START)

D/ValueAnimator( 3305): Start the animation playing

D/ValueAnimator( 3305): ?This sets the initial value of the animation, prior to actually starting it running

D/ValueAnimator( 3305): mInitialized is false!!!

D/ValueAnimator( 3305): mPlayingState == STOPPED!!!

D/ValueAnimator( 3305): getCurrentPlayTime

D/ValueAnimator( 3305): setCurrentPlayTime!!!currentTime is 4213321

D/ValueAnimator( 3305): before animationFrame-----------mStartTime is 4213321

D/ValueAnimator( 3305): after animationFrame-----------mStartTime is 4213321

D/ValueAnimator( 3305): ?onAnimationStart

D/ValueAnimator( 3305): ?animationHandler.sendEmptyMessage(ANIMATION_START)

D/ValueAnimator( 3305): handleMessage:ANIMATION_START

D/ValueAnimator( 3305): startAnimation----Called internally to start an animation by adding it to the active animations list. Must be called on the UI thread

D/ValueAnimator( 3305): anim.startAnimation-----------

D/ValueAnimator( 3305): startAnimation----Called internally to start an animation by adding it to the active animations list. Must be called on the UI thread

D/ValueAnimator( 3305): anim.startAnimation-----------

D/ValueAnimator( 3305): handleMessage:ANIMATION_S

總結

以上是生活随笔為你收集整理的android封装多肽,深度探索C++对象模型之(四)...-Android.animation cts fail-Rails helper_169IT.COM...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。