亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? instrumentation_framework.html

?? Android Porting Guide
?? HTML
字號:
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>Android - Instrumentation Framework</title><script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=internal-codesite" type="text/javascript"></script><script src="http://code.google.com/js/jquery.js" type="text/javascript"></script><script type="text/javascript">var _tocPath_ = 'http://code.google.com/android/_toc.ezt';</script><script src="http://code.google.com/js/codesite.pack.01312008.js" type="text/javascript"></script><link href="http://code.google.com/css/codesite.pack.01312008.css" type="text/css" rel="stylesheet"></link><!--[if IE]><link rel="stylesheet" type="text/css" href="/css/iehacks.css" /><![endif]--><script src="http://code.google.com/android/assets/search_autocomplete.js"></script><link rel="stylesheet" type="text/css" href="http://code.google.com/css/semantic_headers.css" /><link rel="stylesheet" type="text/css" href="http://code.google.com/android/assets/style.css" /><script>    jQuery(document).ready(function() {            jQuery("pre").addClass("prettyprint");        });    </script><style type="text/css"><!--h1,h2,h3 {	color: #000000;}--></style></head><body class="gc-documentation"><div id="gc-container"><a name="top"></a><div id="skipto"> </div><div id="langpref">  <!--<a class="dropdown" href="/">English</a> <span>|</span> <a href="/more/">Site Directory</a> --></div><div id="gc-header">  <div id="logo"><a href="http://code.google.com/android/index.html"><img src="http://code.google.com/android/images/logo_android.gif" alt="Android"/></a></div>  <div id="search" style="inline">    <div id="searchForm" class="searchForm" style="height: 44px;">      <!--previously form was here-->    </div>    <!-- end searchForm -->    <noscript>    <style type="text/css">      .searchForm {        display : none !important;      }      .searchForm2 {        display : inline !important;      }      </style>    </noscript>    <div id="searchForm2" class="searchForm2" style="display:none">      <form id="searchbox_001456098540849067467:6whlsytkdqg" action="http://www.google.com/cse">        <input type="hidden" name="cx" value="001456098540849067467:6whlsytkdqg" />        <input type="hidden" name="cof" value="FORID:0" />        <input type="text" name="q" maxlength="2048" size="41" autocomplete="off" title="Google Code Search"/>        <input type="submit" name="sa" value="Search" title="Search"/>        <br/>        <div class="greytext">e.g. "ajax apis" or "open source"</div>      </form>    </div>    <!-- end searchForm2 -->  </div>  <!-- end search --></div><!-- end gc-header --><div id="searchControl" class="search-control"></div><!--[if IE]><iframe id="backiFrame" name="backiFrame" src='/dummy.html' style="display:none"></iframe><![endif]--><div id="codesiteContent"><a name="gc-topnav-anchor"></a><div id="gc-topnav">  <h1>Android Platform Development Kit</h1>  <ul class="gc-topnav-tabs">    <li id="sdk_link"> <a href="http://code.google.com/android/index.html" title="Android Software Development Kit">SDK</a> </li>    <li id="docs_link"> <a href="index.html" title="Official Android documentation">Docs</a> </li>    <li id="faq_link"> <a href="http://code.google.com/android/kb/index.html" title="Answers to frequently asked questions about Android">FAQ</a> </li>    <li> <a href="http://android-developers.blogspot.com/" title="Official Android blog">Blog</a> </li>    <li> <a href="http://code.google.com/android/groups.html" title="Android developer forum">Group</a> </li>    <li> <a href="http://code.google.com/android/terms.html" title="Android terms of service">Terms</a> </li>    <li> <a href="mailto:android-pdk-feedback@google.com?subject=PDK%20Feedback&body=(filed%20from:%20instrumentation_framework.html%20v0.3%20-%209%20June%202008)%0D%0A%0D%0ASUMMARY:%0D%0A%0D%0A%0D%0A%0D%0ASTEPS%20TO%20REPRODUCE:%0D%0A%0D%0A%0D%0A%0D%0AADDITIONAL%20NOTES:">Report a Problem</a> </li>  </ul></div><!-- end gc-topnav --><div class="g-section g-tpl-180"><a name="gc-toc"></a><div class="g-unit g-first" id="gc-toc">  <ul>    <li>      <h1><a href="index.html">Documentation</a></h1>      <ul>        <li> <strong>Introduction</strong>          <ul>            <li><a href="system_requirements.html">Device Requirements</a></li>                      </ul>        </li>        <li> <strong>Dev Environment Setup</strong>          <ul>            <li><a href="source_setup_guide.html">Host System Setup</a></li>            <li><a href="getting_source_code.html">Getting Source Code</a></li>            <li> <a href="intro_source_code.html">Source Code Overview</a></li>			            <li><a href="build_system.html">Build System</a></li>          </ul>        </li>        <li> <strong>Basic Bring up</strong>          <ul>            <li><a href="build_new_device.html">Building New Device</a></li>            <li><a href="bring_up.html">Bring up</a></li>            <li><a href="keymaps_keyboard_input.html">Keymaps and Keyboard</a></li>            <li><a href="display_drivers.html">Display Drivers</a></li>          </ul>        </li>        <li> <strong>Multimedia</strong>          <ul>            <li><a href="audio_sub_system.html">Audio Subsystem</a></li>          </ul>        </li>        <li> <strong>Power Management</strong>          <ul>            <li><a href="power_management.html">Power Management</a></li>          </ul>        </li>        <li> <strong>Telephony</strong>          <ul>            <li><a href="telephony.html">Radio Interface Layer</a></li>          </ul>        </li>        <li> <strong>Testing</strong>          <ul>            <li><a href="instrumentation_framework.html">Instrumentation Framework</a></li>            <li><a href="instrumentation_testing.html">Instrumentation Testing</a></li>          </ul>        </li>      </ul>    </li>  </ul></div><a name="gc-pagecontent"></a><div class="g-unit" id="gc-pagecontent"><div id="jd-content"><div class="jd-descr"><a name="androidTitleInstrumentationFramework"></a><h1>Instrumentation Framework</h1><a name="toc"/><div style="padding:10px"><a href="#androidInstrumentationFrameworkIntro">Introduction</a><br/><a href="#androidInstrumentationFrameworkamCommand">Understanding the am Command</a><br/><a href="#androidInstrumentationFrameworkWritingRunning">Writing and Running Test Cases</a><br/><a href="#androidInstrumentationFrameworkTestCase">Exploring a Test Case</a><br/><a href="#androidInstrumentationFrameworkTroubleshooting">Troubleshooting</a><br/></div></font></div><a name="androidInstrumentationFrameworkIntro"></a><h2>Introduction</h2><p>This document describes how to use the Instrumentation Framework to write test cases. You should have a working knowledge of the following:</p><ul>  <li> Android Application Framework </li>  <li> Using <code>adb</code>, <code>am</code> and various logging functionality </li>  <li> A brief understanding of the application of interest, that is, he names of the classes which handle the intents etc. </li>  <li> Junit testing. </li></ul><p> Each Android application runs in its own process. Instrumentation kills the application process and  restarts the process with Instrumentation. Instrumentation gives a handle to the application context used to poke around the application to validate test assertions, allowing you to write test cases to test applications at a much lower level than UI screen shot tests. Note that Instrumentation cannot catch UI bugs. </p><a name="androidInstrumentationFrameworkamCommand"></a><h2>Understanding the am Command</h2><p><code>am</code> is used to start and instrument activities using the adb shell command, as shown in the snippet below:</p><pre class="prettify">&gt; adb shell amusage: am [start|instrument]       am start [-a &lt;ACTION&gt;] [-d &lt;DATA_URI&gt;] [-t &lt;MIME_TYPE&gt;]                [-c &lt;CATEGORY&gt; [-c &lt;CATEGORY&gt;] ...]                [-e &lt;EXTRA_KEY&gt; &lt;EXTRA_VALUE&gt; [-e &lt;EXTRA_KEY&gt; &lt;EXTRA_VALUE&gt; ...]                [-n &lt;COMPONENT&gt;] [-D] [&lt;URI&gt;]       am instrument [-e &lt;ARG_NAME&gt; &lt;ARG_VALUE&gt;] [-p &lt;PROF_FILE&gt;]                [-w] &lt;COMPONENT&gt;For example, to start the Contacts application you can use&gt; adb shell am start -n com.google.android.contacts/.ContactsActivity</pre><a name="androidInstrumentationFrameworkWritingRunning"></a><h2>Writing and Running Test Cases</h2><p>Each instrumentation test case is similar to an Android application with the distinction that it starts another application. For example, have a look in the <code>tests/Contacts</code> directory. </p><ul>  <li> There should be a Makefile and an Android Manifest file. </li>  <li> Tests are located in <code>tests/Contacts/src/com/google/android/contactstests</code>. </li>  <li> The Instrumentation Test Runner is located at <code>tests/Contacts/src/com/google/android/contactstests/functional/ContactsInstrumentationTestRunner.java</code>.</li></ul><p>Suppose you have a makefile with <code>Contactstests</code> as the target. </p><ul>  <li> <code>make Contactstests</code>: Compiles the test cases. </li>  <li> <code>adb install Contactstests.apk</code>: Installs the apk on the device. </li>  <li> Use the adb shell <code>am</code> command to run them. </li></ul><p> For options and other details, please see <a href="instrumentation_testing.html" target="_top">Instrumentation Testing</a>.</p><a name="androidInstrumentationFrameworkTestCase"></a><h2>Exploring a Test Case</h2><p> The test case described in this section adds and tests a new Contact. Note that you can send intents, register intent receivers, etc. </p><p><code>Instrumentation.java</code> has helper functions that send key events and string, for example: </p><ul>  <li><code>getInstrumentation()</code>: Returns the handle to the instrumentation </li>  <li><code>sendCharacterSync</code>: Sends a character. </li>  <li><code>sendStringSync</code>: Sends a string to an input box. </li>  <li><code>sendKeyDownUpSync</code>: Sends a specific keyevent. </li>  <li><code>sendTrackballEventSync</code>: Send a trackball event.</li></ul><p> You can find the test case below at <code>device/tests/Contacts.</code></p><pre class="prettify">private void addNewContact(String name, int star, int phoneType, String number, String label,		String email, int emailType){	ContentValues values = new ContentValues();	Uri phoneUri = null;	Uri emailUri = null;	values.put(Contacts.People.NAME, name);	values.put(Contacts.People.STARRED, star);	//Add Phone Numbers	Uri uri = mActivity.getContentResolver().insert(Contacts.People.CONTENT_URI, values);	phoneUri = Uri.withAppendedPath(uri, Contacts.People.Phones.CONTENT_DIRECTORY);	values.clear();	values.put(Contacts.Phones.TYPE, phoneType);	values.put(Contacts.Phones.NUMBER, number);	values.put(Contacts.Phones.LABEL, label);	mActivity.getContentResolver().insert(phoneUri, values);	//Add Email	emailUri = Uri.withAppendedPath(uri, ContactMethods.CONTENT_DIRECTORY);	values.clear();	values.put(ContactMethods.KIND, Contacts.KIND_EMAIL);	values.put(ContactMethods.DATA, email);	values.put(ContactMethods.LABEL, "");	values.put(ContactMethods.TYPE, emailType);	mActivity.getContentResolver().insert(emailUri, values);} public void testAddSaveSingleContact(){	int previousCount = mActivity.getListView().getCount();	String message;	addNewContact(INPUT_NAME_1 + "1", "5435754532", "1" + INPUT_EMAIL_1, CONFIRM_OPTION);	message = "Added 1 to initial length=" + previousCount + ", but resulted with a count=" +		mActivity.getListView().getCount();	assertEquals(message, ++previousCount, mActivity.getListView().getCount());	// Check Content; Name; Num; Starred	assertEquals(INPUT_NAME_1 + "1", getTextFromView(0, android.R.id.text1));	assertEquals("5435754532", getTextFromView(0, android.R.id.text2));	//Check email is saved	//cursor = returnEmailCursorAtId("1");	Uri uri = Uri.parse("content://contacts/people/1");	uri = Uri.withAppendedPath(uri, ContactMethods.CONTENT_DIRECTORY);	Cursor cursor = mActivity.getContentResolver().query(uri, CONTACTS_COLUMNS, null, null, null);	assertTrue("returnEmailCursorAtId: Moving cursor to first row has failed", cursor.first());	int dataIndex = cursor.getColumnIndexOrThrow("data");	assertEquals("1" + INPUT_EMAIL_1, cursor.getString(dataIndex));	cursor.deactivate();}	</pre><a name="androidInstrumentationFrameworkTroubleshooting"></a><h2>Troubleshooting</h2><p>If you run your test cases and nothing appears to happen, have a look at <code>adb logcat</code>. The following is a common problem:</p><pre class="prettify">I/dalvikvm(  688): threadid=11: attached from native, name=Binder Thread #1I/dalvikvm(  688): threadid=13: attached from native, name=Binder Thread #2W/ActivityManager(  469): Unable to find instrumentation info for: ComponentInfo{com.google.android.browser_instrumentation/com.google.android.browser_instrumentation.BrowserWebkitLayoutInstrumentation}D/AndroidRuntime(  688): Shutting down VME/AndroidRuntime(  688): ERROR: thread attach failed</pre>		<p>It's possible that the instrumentation apk isn't installed on your device or that the package name is incorrect in the Manifest file. </p><p><span class="lh2"><a name="androidFooter"></a></span>        </div>      </div>      <!-- end gc-pagecontent -->    </div>    <!-- end gooey wrapper -->  </div>  <!-- end codesearchresults -->  <div id="gc-footer" dir="ltr">    <div class="text"> &copy;2008 Google<!-- - <a href="/">Code Home</a> - <a href="http://www.google.com/accounts/TOS">Site Terms of Service</a> - <a href="http://www.google.com/privacy.html">Privacy Policy</a> - <a href="/more">Site Directory</a> --></div>  </div>  <!-- end gc-footer --></div><!-- end gc-containter --><script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script><script type="text/javascript">  try {    var pageTracker = _gat._getTracker("UA-18071-1");    pageTracker._setAllowAnchor(true);    pageTracker._initData();    pageTracker._trackPageview();   } catch(e) {}</script><div id="jd-build-id"> v0.3 - 9 June 2008</div></div></div></div></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三| 精品sm在线观看| 日韩福利视频导航| 久久精品视频一区| 91精品福利在线| 亚洲成人福利片| 国产欧美精品一区aⅴ影院| 欧美最新大片在线看| 国产精品18久久久久久久网站| 日韩一区在线播放| 在线看国产一区二区| 国产99久久久精品| 日本亚洲一区二区| 综合在线观看色| 欧美成人性福生活免费看| av电影在线观看不卡| 国产一区二区三区最好精华液| 亚洲视频在线一区观看| 中文字幕欧美国产| 精品日韩99亚洲| 日本高清不卡视频| 成人免费毛片片v| 久久精品国产亚洲aⅴ| 亚洲国产aⅴ成人精品无吗| 国产欧美一区二区精品性色| 91网上在线视频| k8久久久一区二区三区| 久久国产精品露脸对白| 日本不卡免费在线视频| 一区二区三区精品在线观看| 国产精品美女一区二区在线观看| 91精品国产综合久久久蜜臀粉嫩| 97国产精品videossex| 国产成+人+日韩+欧美+亚洲| 奇米一区二区三区av| 国产精品美女久久福利网站| 国产精品女人毛片| 久久久久99精品一区| 精品处破学生在线二十三| 欧美日韩国产系列| 99久久er热在这里只有精品66| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 色综合天天综合色综合av | 在线成人免费观看| 欧美在线一二三四区| 色欧美日韩亚洲| 色哟哟国产精品| 99麻豆久久久国产精品免费| 日韩精品三区四区| 五月婷婷色综合| 亚洲一区中文在线| 洋洋av久久久久久久一区| 中文字幕不卡在线观看| 国产亚洲美州欧州综合国| 国产婷婷色一区二区三区四区| 精品国产乱码久久久久久免费| 91精品国产色综合久久| 9l国产精品久久久久麻豆| 国产成人免费高清| 国产黄色成人av| 国产一区二区三区久久悠悠色av| 蜜臀av性久久久久蜜臀aⅴ流畅| 一区二区三区免费在线观看| 亚洲日本va午夜在线电影| 国产欧美中文在线| 亚洲日本电影在线| 一区二区三区在线观看动漫| 日韩福利电影在线| 日本不卡一区二区三区高清视频| 日本欧美在线观看| 国内精品伊人久久久久影院对白| 看电视剧不卡顿的网站| 国产一区二区三区高清播放| 国产成人免费在线观看不卡| 91视频你懂的| 欧美久久一二三四区| 欧美大胆一级视频| 中文子幕无线码一区tr| 最新热久久免费视频| 亚洲一区二区在线观看视频| 婷婷久久综合九色综合绿巨人| 国产在线不卡一区| 97久久精品人人澡人人爽| 成人午夜大片免费观看| 欧美亚洲高清一区二区三区不卡| 欧美精品tushy高清| 久久久五月婷婷| 亚洲女人的天堂| 黄色精品一二区| 91亚洲午夜精品久久久久久| 欧美日韩国产一级| 国产精品免费看片| 亚洲成人黄色影院| aaa国产一区| 91麻豆精品国产91久久久资源速度| 久久美女高清视频| 亚洲午夜久久久久久久久久久 | 在线观看区一区二| 欧美一区二区视频在线观看2022| 国产精品免费久久| 日韩国产高清影视| 色久综合一二码| 91精品国产综合久久久久| 国产人成亚洲第一网站在线播放 | 亚洲一区二区三区不卡国产欧美| 精品一区二区三区免费播放| 日本道精品一区二区三区| 日韩区在线观看| 一区二区视频在线| 国产麻豆精品在线观看| 99国产精品久久久久久久久久| 欧美精选午夜久久久乱码6080| 久久精品视频免费观看| 亚洲黄色在线视频| 国产一区二区三区四区五区入口| 欧美中文字幕久久| 亚洲欧美二区三区| 国产在线不卡一区| 在线成人av影院| 亚洲三级免费观看| 轻轻草成人在线| 欧洲精品视频在线观看| 久久久久久久久久美女| 日本欧美一区二区三区乱码 | 99久久精品免费看国产| 欧美大尺度电影在线| 亚洲在线成人精品| 日本久久一区二区| 国产精品拍天天在线| 成人深夜在线观看| 久久无码av三级| 久久av资源站| 欧美一级高清片在线观看| 成人免费一区二区三区在线观看 | 日韩在线一区二区三区| 97精品久久久午夜一区二区三区 | 99re8在线精品视频免费播放| 欧美精品一区二区在线播放| 亚洲成人自拍一区| 欧美系列亚洲系列| 亚洲美女视频在线观看| 一本色道久久综合亚洲91| 国产精品每日更新在线播放网址 | 91视频一区二区三区| 日本韩国精品在线| 亚洲第一二三四区| 欧美日韩在线播放三区四区| 亚洲精品乱码久久久久久| 色哟哟一区二区在线观看| 亚洲激情在线激情| 91成人网在线| 日本亚洲最大的色成网站www| 777奇米成人网| 一区二区三区免费看视频| 日本精品一区二区三区四区的功能| 国产精品亲子伦对白| a亚洲天堂av| 亚洲欧美日韩久久精品| 顶级嫩模精品视频在线看| 亚洲国产成人私人影院tom| 成人国产精品视频| 亚洲欧美偷拍三级| 91在线丨porny丨国产| 亚洲天堂av老司机| 欧美在线不卡一区| 一色桃子久久精品亚洲| 精品视频一区二区三区免费| 亚洲超碰97人人做人人爱| 欧美一级日韩免费不卡| 久久精品国产成人一区二区三区| 日韩午夜激情视频| 福利电影一区二区| 日韩理论电影院| 日韩欧美激情一区| 日本强好片久久久久久aaa| 欧美mv日韩mv国产网站| 国产精品1区二区.| 中文字幕在线视频一区| 在线观看亚洲精品| 亚洲激情中文1区| 欧美精品一区二区三区蜜臀| 成人午夜私人影院| 亚洲成人综合视频| www激情久久| 92精品国产成人观看免费| 亚洲成人综合视频| 欧美一级专区免费大片| 国产mv日韩mv欧美| 中文字幕av一区二区三区| 欧洲精品在线观看| 三级亚洲高清视频| 国产色一区二区| 欧美特级限制片免费在线观看| 亚洲成av人在线观看| 337p日本欧洲亚洲大胆精品| 色综合久久天天| a美女胸又www黄视频久久| 麻豆成人免费电影| 日韩久久一区二区| 久久精品水蜜桃av综合天堂|