mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
Fix doc snippets. (#3882)
* Remove a duplicate snippet: image-create-datauri * Remove a reference to a missing snippet: console-dump * Readd a missing snippet: imagesource-resname * Fix a broken snippet reference: timer-set-ten * Fix a broken snippet reference: timer-set-fifty
This commit is contained in:
@ -26,10 +26,6 @@ Asserts a boolean condition and prints a message in case the assert fails.
|
||||
Prints the state of the specified object to the console.
|
||||
{%snippet console-dir%}
|
||||
|
||||
### Dump
|
||||
Prints the state of the specified object to the console.
|
||||
{%snippet console-dump%}
|
||||
|
||||
### Trace
|
||||
Prints the current stack trace in the console.
|
||||
{%snippet console-trace%}
|
||||
|
@ -16,7 +16,9 @@ var imagePath = "~/logo.png";
|
||||
var smallImagePath = "~/small-image.png";
|
||||
|
||||
export function testFromResource() {
|
||||
// >> imagesource-resname
|
||||
var img = imageSource.fromResource("icon");
|
||||
// << imagesource-resname
|
||||
TKUnit.assert(img.height > 0, "image.fromResource failed");
|
||||
}
|
||||
|
||||
|
@ -82,12 +82,11 @@ export function test_setTimeout_callbackShouldBeCleared() {
|
||||
completed = true;
|
||||
// << (hide)
|
||||
}, 50);
|
||||
// << timer-set-fifty
|
||||
|
||||
//// Clear timeout with specified id.
|
||||
timer.clearTimeout(id);
|
||||
|
||||
// << timer-set-twothousands
|
||||
// << timer-set-fifty
|
||||
|
||||
TKUnit.wait(0.060);
|
||||
timer.clearTimeout(id);
|
||||
|
@ -13,10 +13,10 @@ previous_url: /ApiReference/timer/HOW-TO
|
||||
{%snippet timer-set-zero%}
|
||||
|
||||
### Evaluates an expression after a specified number of milliseconds.
|
||||
{%snippet timer-set-fivehundred%}
|
||||
{%snippet timer-set-ten%}
|
||||
|
||||
### Cancels the evaluation with the clearTimeout method.
|
||||
{%snippet timer-set-twothousands%}
|
||||
{%snippet timer-set-fifty%}
|
||||
|
||||
### Evaluates an expression each time a specified number of milliseconds has elapsed.
|
||||
{%snippet timer-set-expression%}
|
||||
|
@ -126,10 +126,8 @@ export const test_SettingImageSrcToDataURI_sync = function () {
|
||||
};
|
||||
|
||||
export const test_SettingImageSrcToDataURI_async = function (done) {
|
||||
// >> img-create-datauri
|
||||
const image = new ImageModule.Image();
|
||||
image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAAXNSR0IArs4c6QAAABxpRE9UAAAAAgAAAAAAAAACAAAAKAAAAAIAAAACAAAARiS4uJEAAAASSURBVBgZYvjPwABHSMz/DAAAAAD//0GWpK0AAAAOSURBVGNgYPiPhBgQAACEvQv1D5y/pAAAAABJRU5ErkJggg==";
|
||||
// << img-create-datauri
|
||||
|
||||
runImageTestAsync(image, image.src, done);
|
||||
};
|
||||
|
Reference in New Issue
Block a user