1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note: 2 1) The <head> information in this page is significant, should be uniform 3 across api docs and should be edited only with knowledge of the 4 templating mechanism. 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a 6 browser, it will be re-generated from the template, json schema and 7 authored overview content. 8 4) The <body>.innerHTML is also generated by an offline step so that this 9 page may easily be indexed by search engines. 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstemplate_compiled.js"> 15 </script> 16 <script type="text/javascript" src="js/api_page_generator.js"></script> 17 <script type="text/javascript" src="js/bootstrap.js"></script> 18 <title>chrome.test - Google Chrome Extensions - Google Code</title></head><body> <div id="gc-container" class="labs"> 19 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> 20 <!-- In particular, sub-templates that recurse, must be used by allowing 21 jstemplate to make a copy of the template in this section which 22 are not operated on by way of the jsskip="true" --> 23 <div style="display:none"> 24 25 <!-- VALUE --> 26 <div id="valueTemplate"> 27 <dt> 28 <var>paramName</var> 29 <em> 30 31 <!-- TYPE --> 32 <div style="display:inline"> 33 ( 34 <span class="optional">optional</span> 35 <span id="typeTemplate"> 36 <span> 37 <a> Type</a> 38 </span> 39 <span> 40 <span> 41 array of <span><span></span></span> 42 </span> 43 <span>paramType</span> 44 </span> 45 </span> 46 ) 47 </div> 48 49 </em> 50 </dt> 51 <dd class="todo"> 52 Undocumented. 53 </dd> 54 <dd> 55 Description of this parameter from the json schema. 56 </dd> 57 58 <!-- OBJECT PROPERTIES --> 59 <dd> 60 <dl> 61 <div> 62 <div> 63 </div> 64 </div> 65 </dl> 66 </dd> 67 </div> <!-- /VALUE --> 68 69 </div> <!-- /SUBTEMPLATES --> 70 71 <a id="top"></a> 72 <div id="skipto"> 73 <a href="#gc-pagecontent">Skip to page content</a> 74 <a href="#gc-toc">Skip to main navigation</a> 75 </div> 76 <!-- API HEADER --> 77 <table id="header" width="100%" cellspacing="0" border="0"> 78 <tbody><tr> 79 <td valign="middle"><a href="http://code.google.com/"><img src="images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td> 80 <td valign="middle" width="100%" style="padding-left:0.6em;"> 81 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em"> 82 <div id="gsc-search-box"> 83 <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno"> 84 <input type="hidden" name="ie" value="UTF-8"> 85 <input type="text" name="q" value="" size="55"> 86 <input class="gsc-search-button" type="submit" name="sa" value="Search"> 87 <br> 88 <span class="greytext">e.g. "page action" or "tabs"</span> 89 </div> 90 </form> 91 92 <script type="text/javascript" src="http://www.google.com/jsapi"></script> 93 <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> 94 <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse&t13n_langs=en"></script> 95 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse&lang=en"></script> 96 </td> 97 </tr> 98 </tbody></table> 99 100 <div id="codesiteContent" class=""> 101 102 <a id="gc-topnav-anchor"></a> 103 <div id="gc-topnav"> 104 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1> 105 <ul id="home" class="gc-topnav-tabs"> 106 <li id="home_link"> 107 <a href="index.html" title="Google Chrome Extensions home page">Home</a> 108 </li> 109 <li id="docs_link"> 110 <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a> 111 </li> 112 <li id="faq_link"> 113 <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a> 114 </li> 115 <li id="samples_link"> 116 <a href="samples.html" title="Sample extensions (with source code)">Samples</a> 117 </li> 118 <li id="group_link"> 119 <a href="http://groups.google.com/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a> 120 </li> 121 </ul> 122 </div> <!-- end gc-topnav --> 123 124 <div class="g-section g-tpl-170"> 125 <!-- SIDENAV --> 126 <div class="g-unit g-first" id="gc-toc"> 127 <ul> 128 <li><a href="getstarted.html">Getting Started</a></li> 129 <li><a href="overview.html">Overview</a></li> 130 <li><h2><a href="devguide.html">Developer's Guide</a></h2> 131 <ul> 132 <li>Browser UI 133 <ul> 134 <li><a href="browserAction.html">Browser Actions</a></li> 135 <li><a href="options.html">Options Pages</a></li> 136 <li><a href="override.html">Override Pages</a></li> 137 <li><a href="pageAction.html">Page Actions</a></li> 138 <li><a href="themes.html">Themes</a></li> 139 </ul> 140 </li> 141 <li>Browser Interaction 142 <ul> 143 <li><a href="bookmarks.html">Bookmarks</a></li> 144 <li><a href="events.html">Events</a></li> 145 <li><a href="tabs.html">Tabs</a></li> 146 <li><a href="windows.html">Windows</a></li> 147 </ul> 148 </li> 149 <li>Implementation 150 <ul> 151 <li><a href="background_pages.html">Background Pages</a></li> 152 <li><a href="content_scripts.html">Content Scripts</a></li> 153 <li><a href="xhr.html">Cross-Origin XHR</a></li> 154 <li><a href="i18n.html">Internationalization</a></li> 155 <li><a href="messaging.html">Message Passing</a></li> 156 <li><a href="npapi.html">NPAPI Plugins</a></li> 157 </ul> 158 </li> 159 <li>Finishing 160 <ul> 161 <li><a href="autoupdate.html">Autoupdating</a></li> 162 <li><a href="packaging.html">Packaging</a></li> 163 <li><a href="external_extensions.html">External Extensions</a></li> 164 </ul> 165 </li> 166 </ul> 167 </li> 168 <li><h2><a href="tutorials.html">Tutorials</a></h2> 169 <ul> 170 <li><a href="tut_debugging.html">Debugging</a></li> 171 </ul> 172 </li> 173 <li><h2>Reference</h2> 174 <ul> 175 <li>Formats 176 <ul> 177 <li><a href="manifest.html">Manifest Files</a></li> 178 <li><a href="match_patterns.html">Match Patterns</a></li> 179 <!-- <li>Packages (.crx)</li> --> 180 </ul> 181 </li> 182 <li><a href="api_index.html">chrome.* APIs</a></li> 183 <li><a href="api_other.html">Other APIs</a></li> 184 </ul> 185 </li> 186 <li><h2><a href="samples.html">Samples</a></h2></li> 187 </ul> 188 </div> 189 190 <div class="g-unit" id="gc-pagecontent"> 191 <div id="pageTitle"> 192 <h1 class="page_title">chrome.test</h1> 193 </div> 194 <!-- TABLE OF CONTENTS --> 195 <div id="toc"> 196 <h2>Contents</h2> 197 <ol> 198 <li style="display: none; "> 199 <a>h2Name</a> 200 <ol> 201 <li> 202 <a>h3Name</a> 203 </li> 204 </ol> 205 </li> 206 <li> 207 <a href="#apiReference">API reference: chrome.test</a> 208 <ol> 209 <li style="display: none; "> 210 <a href="#properties">Properties</a> 211 <ol> 212 <li> 213 <a href="#property-anchor">propertyName</a> 214 </li> 215 </ol> 216 </li> 217 <li> 218 <a href="#methods">Methods</a> 219 <ol> 220 <li> 221 <a href="#method-log">log</a> 222 </li><li> 223 <a href="#method-notifyFail">notifyFail</a> 224 </li><li> 225 <a href="#method-notifyPass">notifyPass</a> 226 </li><li> 227 <a href="#method-resetQuota">resetQuota</a> 228 </li> 229 </ol> 230 </li> 231 <li style="display: none; "> 232 <a href="#events">Events</a> 233 <ol> 234 <li> 235 <a href="#event-anchor">eventName</a> 236 </li> 237 </ol> 238 </li> 239 <li style="display: none; "> 240 <a href="#types">Types</a> 241 <ol> 242 <li> 243 <a href="#id-anchor">id</a> 244 </li> 245 </ol> 246 </li> 247 </ol> 248 </li> 249 </ol> 250 </div> 251 <!-- /TABLE OF CONTENTS --> 252 253 <!-- STATIC CONTENT PLACEHOLDER --> 254 <div id="static"></div> 255 256 <!-- API PAGE --> 257 <div class="apiPage"> 258 <a name="apiReference"></a> 259 <h2>API reference: chrome.test</h2> 260 261 <!-- PROPERTIES --> 262 <div class="apiGroup" style="display: none; "> 263 <a name="properties"></a> 264 <h3 id="properties">Properties</h3> 265 266 <div> 267 <a></a> 268 <h4>getLastError</h4> 269 <div class="summary"> 270 <!-- Note: intentionally longer 80 columns --> 271 <span>chrome.extension</span><span>lastError</span> 272 </div> 273 <div> 274 </div> 275 </div> 276 277 </div> <!-- /apiGroup --> 278 279 <!-- METHODS --> 280 <div class="apiGroup" id="methods"> 281 <a name="methods"></a> 282 <h3>Methods</h3> 283 284 <!-- iterates over all functions --> 285 <div class="apiItem"> 286 <a name="method-log"></a> <!-- method-anchor --> 287 <h4>log</h4> 288 289 <div class="summary"><span style="display: none; ">void</span> 290 <!-- Note: intentionally longer 80 columns --> 291 <span>chrome.test.log</span>(<span class="null"><span style="display: none; ">, </span><span>string</span> 292 <var><span>message</span></var></span>)</div> 293 294 <div class="description"> 295 <p class="todo" style="display: none; ">Undocumented.</p> 296 <p>Logs a message during internal unit testing.</p> 297 298 <!-- PARAMETERS --> 299 <h4>Parameters</h4> 300 <dl> 301 <div> 302 <div> 303 <dt> 304 <var>message</var> 305 <em> 306 307 <!-- TYPE --> 308 <div style="display:inline"> 309 ( 310 <span class="optional" style="display: none; ">optional</span> 311 <span id="typeTemplate"> 312 <span style="display: none; "> 313 <a> Type</a> 314 </span> 315 <span> 316 <span style="display: none; "> 317 array of <span><span></span></span> 318 </span> 319 <span>string</span> 320 </span> 321 </span> 322 ) 323 </div> 324 325 </em> 326 </dt> 327 <dd class="todo"> 328 Undocumented. 329 </dd> 330 <dd style="display: none; "> 331 Description of this parameter from the json schema. 332 </dd> 333 334 <!-- OBJECT PROPERTIES --> 335 <dd style="display: none; "> 336 <dl> 337 <div> 338 <div> 339 </div> 340 </div> 341 </dl> 342 </dd> 343 </div> 344 </div> 345 </dl> 346 347 <!-- RETURNS --> 348 <h4 style="display: none; ">Returns</h4> 349 <dl> 350 <div style="display: none; "> 351 <div> 352 </div> 353 </div> 354 </dl> 355 356 <!-- CALLBACK --> 357 <div style="display: none; "> 358 <div> 359 <h4>Callback function</h4> 360 <p> 361 The callback <em>parameter</em> should specify a function 362 that looks like this: 363 </p> 364 <p> 365 If you specify the <em>callback</em> parameter, it should 366 specify a function that looks like this: 367 </p> 368 369 <!-- Note: intentionally longer 80 columns --> 370 <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> 371 <dl> 372 <div> 373 <div> 374 </div> 375 </div> 376 </dl> 377 </div> 378 </div> 379 380 </div> <!-- /description --> 381 382 </div><div class="apiItem"> 383 <a name="method-notifyFail"></a> <!-- method-anchor --> 384 <h4>notifyFail</h4> 385 386 <div class="summary"><span style="display: none; ">void</span> 387 <!-- Note: intentionally longer 80 columns --> 388 <span>chrome.test.notifyFail</span>(<span class="null"><span style="display: none; ">, </span><span>string</span> 389 <var><span>message</span></var></span>)</div> 390 391 <div class="description"> 392 <p class="todo" style="display: none; ">Undocumented.</p> 393 <p>Notify the browser process that test code running in the extension failed. This is only used for internal unit testing.</p> 394 395 <!-- PARAMETERS --> 396 <h4>Parameters</h4> 397 <dl> 398 <div> 399 <div> 400 <dt> 401 <var>message</var> 402 <em> 403 404 <!-- TYPE --> 405 <div style="display:inline"> 406 ( 407 <span class="optional" style="display: none; ">optional</span> 408 <span id="typeTemplate"> 409 <span style="display: none; "> 410 <a> Type</a> 411 </span> 412 <span> 413 <span style="display: none; "> 414 array of <span><span></span></span> 415 </span> 416 <span>string</span> 417 </span> 418 </span> 419 ) 420 </div> 421 422 </em> 423 </dt> 424 <dd class="todo"> 425 Undocumented. 426 </dd> 427 <dd style="display: none; "> 428 Description of this parameter from the json schema. 429 </dd> 430 431 <!-- OBJECT PROPERTIES --> 432 <dd style="display: none; "> 433 <dl> 434 <div> 435 <div> 436 </div> 437 </div> 438 </dl> 439 </dd> 440 </div> 441 </div> 442 </dl> 443 444 <!-- RETURNS --> 445 <h4 style="display: none; ">Returns</h4> 446 <dl> 447 <div style="display: none; "> 448 <div> 449 </div> 450 </div> 451 </dl> 452 453 <!-- CALLBACK --> 454 <div style="display: none; "> 455 <div> 456 <h4>Callback function</h4> 457 <p> 458 The callback <em>parameter</em> should specify a function 459 that looks like this: 460 </p> 461 <p> 462 If you specify the <em>callback</em> parameter, it should 463 specify a function that looks like this: 464 </p> 465 466 <!-- Note: intentionally longer 80 columns --> 467 <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> 468 <dl> 469 <div> 470 <div> 471 </div> 472 </div> 473 </dl> 474 </div> 475 </div> 476 477 </div> <!-- /description --> 478 479 </div><div class="apiItem"> 480 <a name="method-notifyPass"></a> <!-- method-anchor --> 481 <h4>notifyPass</h4> 482 483 <div class="summary"><span style="display: none; ">void</span> 484 <!-- Note: intentionally longer 80 columns --> 485 <span>chrome.test.notifyPass</span>(<span class="optional"><span style="display: none; ">, </span><span>string</span> 486 <var><span>message</span></var></span>)</div> 487 488 <div class="description"> 489 <p class="todo" style="display: none; ">Undocumented.</p> 490 <p>Notify the browser process that test code running in the extension passed. This is only used for internal unit testing.</p> 491 492 <!-- PARAMETERS --> 493 <h4>Parameters</h4> 494 <dl> 495 <div> 496 <div> 497 <dt> 498 <var>message</var> 499 <em> 500 501 <!-- TYPE --> 502 <div style="display:inline"> 503 ( 504 <span class="optional">optional</span> 505 <span id="typeTemplate"> 506 <span style="display: none; "> 507 <a> Type</a> 508 </span> 509 <span> 510 <span style="display: none; "> 511 array of <span><span></span></span> 512 </span> 513 <span>string</span> 514 </span> 515 </span> 516 ) 517 </div> 518 519 </em> 520 </dt> 521 <dd class="todo"> 522 Undocumented. 523 </dd> 524 <dd style="display: none; "> 525 Description of this parameter from the json schema. 526 </dd> 527 528 <!-- OBJECT PROPERTIES --> 529 <dd style="display: none; "> 530 <dl> 531 <div> 532 <div> 533 </div> 534 </div> 535 </dl> 536 </dd> 537 </div> 538 </div> 539 </dl> 540 541 <!-- RETURNS --> 542 <h4 style="display: none; ">Returns</h4> 543 <dl> 544 <div style="display: none; "> 545 <div> 546 </div> 547 </div> 548 </dl> 549 550 <!-- CALLBACK --> 551 <div style="display: none; "> 552 <div> 553 <h4>Callback function</h4> 554 <p> 555 The callback <em>parameter</em> should specify a function 556 that looks like this: 557 </p> 558 <p> 559 If you specify the <em>callback</em> parameter, it should 560 specify a function that looks like this: 561 </p> 562 563 <!-- Note: intentionally longer 80 columns --> 564 <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> 565 <dl> 566 <div> 567 <div> 568 </div> 569 </div> 570 </dl> 571 </div> 572 </div> 573 574 </div> <!-- /description --> 575 576 </div><div class="apiItem"> 577 <a name="method-resetQuota"></a> <!-- method-anchor --> 578 <h4>resetQuota</h4> 579 580 <div class="summary"><span style="display: none; ">void</span> 581 <!-- Note: intentionally longer 80 columns --> 582 <span>chrome.test.resetQuota</span>(<span style="display: none; "><span>, </span><span></span> 583 <var><span></span></var></span>)</div> 584 585 <div class="description"> 586 <p class="todo" style="display: none; ">Undocumented.</p> 587 <p>Reset all accumulated quota state for all extensions. This is only used for internal unit testing.</p> 588 589 <!-- PARAMETERS --> 590 <h4>Parameters</h4> 591 <dl> 592 <div style="display: none; "> 593 <div> 594 </div> 595 </div> 596 </dl> 597 598 <!-- RETURNS --> 599 <h4 style="display: none; ">Returns</h4> 600 <dl> 601 <div style="display: none; "> 602 <div> 603 </div> 604 </div> 605 </dl> 606 607 <!-- CALLBACK --> 608 <div style="display: none; "> 609 <div> 610 <h4>Callback function</h4> 611 <p> 612 The callback <em>parameter</em> should specify a function 613 that looks like this: 614 </p> 615 <p> 616 If you specify the <em>callback</em> parameter, it should 617 specify a function that looks like this: 618 </p> 619 620 <!-- Note: intentionally longer 80 columns --> 621 <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> 622 <dl> 623 <div> 624 <div> 625 </div> 626 </div> 627 </dl> 628 </div> 629 </div> 630 631 </div> <!-- /description --> 632 633 </div> <!-- /apiItem --> 634 635 </div> <!-- /apiGroup --> 636 637 <!-- EVENTS --> 638 <div class="apiGroup" style="display: none; "> 639 <a name="events"></a> 640 <h3 id="events">Events</h3> 641 642 <!-- iterates over all events --> 643 <div class="apiItem"> 644 <a></a> 645 <h4>event name</h4> 646 647 <div class="summary"> 648 <!-- Note: intentionally longer 80 columns --> 649 <span class="subdued">chrome.bookmarks</span><span>onEvent</span><span class="subdued">.addListener</span>(function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>); 650 </div> 651 652 <div class="description"> 653 <p class="todo">Undocumented.</p> 654 <p> 655 A description from the json schema def of the event goes here. 656 </p> 657 658 <!-- PARAMETERS --> 659 <h4>Parameters</h4> 660 <dl> 661 <div> 662 <div> 663 </div> 664 </div> 665 </dl> 666 667 </div> <!-- /decription --> 668 669 </div> <!-- /apiItem --> 670 671 </div> <!-- /apiGroup --> 672 673 <!-- TYPES --> 674 <div class="apiGroup" style="display: none; "> 675 <a name="types.sort(sortByName)"></a> 676 <h3 id="types">Types</h3> 677 678 <!-- iterates over all types --> 679 <div class="apiItem"> 680 <a></a> 681 <h4>type name</h4> 682 683 <div> 684 </div> 685 686 </div> <!-- /apiItem --> 687 688 </div> <!-- /apiGroup --> 689 690 </div> <!-- /apiPage --> 691 </div> <!-- /gc-pagecontent --> 692 </div> <!-- /g-section --> 693 </div> <!-- /codesiteContent --> 694 <div id="gc-footer" --=""> 695 <div class="text"> 696 <p> 697 Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>, 698 the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons 699 Attribution 3.0 License</a>, and code samples are licensed under the 700 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>. 701 </p> 702 <p> 703 2009 Google 704 </p> 705 706 <!-- begin analytics --> 707 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> 708 <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script> 709 710 <script type="text/javascript"> 711 // chrome doc tracking 712 try { 713 var engdocs = _gat._getTracker("YT-10763712-2"); 714 engdocs._trackPageview(); 715 } catch(err) {} 716 717 // code.google.com site-wide tracking 718 try { 719 _uacct="UA-18071-1"; 720 _uanchor=1; 721 _uff=0; 722 urchinTracker(); 723 } 724 catch(e) {/* urchinTracker not available. */} 725 </script> 726 <!-- end analytics --> 727 </div> 728 </div> <!-- /gc-footer --> 729 </div> <!-- /gc-container --> 730 </body></html> 731