This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:html'; | |
void main() { | |
query("#sample_text_id") | |
..text = "Click me!" | |
..onClick.listen(reverseText); | |
} | |
void reverseText(MouseEvent event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Headless</title> | |
<link rel="stylesheet" href="headless.css"> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:unittest/html_enhanced_config.dart'; | |
import 'package:unittest/unittest.dart'; | |
import 'dart:html'; | |
import 'headless.dart' as app; | |
main() { | |
useHtmlEnhancedConfiguration(); | |
app.main(); | |
var sample_text = query("#sample_text_id"); | |
test('text says Click Me!', (){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Headless</title> | |
<link rel="stylesheet" href="headless.css"> | |
</head> | |
<body> | |
<div id="sample_container_id"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ content_shell --dump-render-tree web/headless.html | |
Content-Type: text/plain | |
layer at (0,0) size 800x600 | |
RenderView at (0,0) size 800x600 | |
layer at (0,0) size 800x432 | |
RenderBlock {HTML} at (0,0) size 800x432 | |
RenderBody {BODY} at (15,15) size 770x402 [bgcolor=#F8F8F8] | |
layer at (15,15) size 772x402 | |
RenderBlock (relative positioned) {DIV} at (0,0) size 772x402 [bgcolor=#FFFFFF] [border: (1px solid #CCCCCC)] | |
RenderBlock {P} at (1,141) size 770x16 [color=#333333] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ content_shell --dump-render-tree web/headless_test.html | |
Content-Type: text/plain | |
PASS | |
All 2 tests passed | |
Collapse All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library hop_runner; | |
import 'package:hop/hop.dart'; | |
import 'package:hop/hop_tasks.dart'; | |
import 'dart:io'; | |
import 'dart:async'; | |
main() { | |
var paths = ['web/headless.dart','web/headless_test.dart']; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dart tool/hop_runner.dart test | |
test: Running Unit Tests.... | |
test: Content-Type: text/plain | |
PASS | |
All 2 tests passed | |
Collapse All | |
#EOF | |
#EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo start xvfb | |
dart tool/hop_runner.dart test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<element name="x-medsafeinput" constructor="MedSafeInput" extends="div"> | |
<template> | |
<input type="number" placeholder="Weight (kg)" bind-value="inputstr" on-change="changed()"> | |
</template> | |
<script type="application/dart" src="xmedsafeinput.dart"></script> | |
</element> |