From 44c8dfcec6e04a19ef78e2de38c97f49f9fcb8d5 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Tue, 29 Dec 2020 03:03:38 -0800 Subject: [PATCH] test: test test-page.html --- .gitignore | 3 ++- test/test | Bin 49784 -> 0 bytes test/test-page.html | 11 +++++++++++ test/test-script.js | 1 + test/test.c | 24 ++++++++++++++---------- 5 files changed, 28 insertions(+), 11 deletions(-) delete mode 100755 test/test create mode 100644 test/test-page.html create mode 100644 test/test-script.js mode change 100755 => 100644 test/test.c diff --git a/.gitignore b/.gitignore index 0a47e76..4467a5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store scratch fs/tabfs -fs/tabfs.dSYM \ No newline at end of file +fs/tabfs.dSYM +test/test \ No newline at end of file diff --git a/test/test b/test/test deleted file mode 100755 index 36de26f71716c24619b4a5e568535f684bb25a67..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49784 zcmeI4U2GiH702)93j=kWsEDt&VOWyLMv2$uqiUi$b->$fL>e0sAOb~~*`4d`lGzzE zbH}mOR@&5|?bcYbR6t0)M187&2OcN_3!#`GB`>H^p88M;g9KWOfWliqA?`VIXYAcg zEU5Z`TK%td=iGDV-v2%4cX#*g?mxc%{K|DgWL66yR#D$T{m@z=o)s32gt(1*fx48# zyZ7Xu$Uic~(bkq}b+75M&Od3Qln3*N4z^B-*AKMDMB-B_BJDgwO0C8m- z=+$X1h8p{8%+Ng7h+4BNWvHWKxD;yF8~laQ+nmfu{d7S`qPH#y7(H25?x+eV)~;7h z^!6q5*-uh6k*o46g*vEsN0#(k`Mr_oT~0*UZ*DEx^g_zWJ67==S@A~v*l*Q){g*!5_KsDcOTp>9~|0$z?|-Y(Gg_h)@J$h#+}cKKXXzZ@tclyMZFH1 z8@B$^MD#A+jvP?;GU*fb9I7`5fFx<6-LD(mnY5$KT;* z4*b5k{f*XlHV2aNda@RE-Xj-YRhR~DVgP5D4zop zp;p!22YM;5N|7c}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Ap!jjWcX8ds%AD_K@Hr?G3K;woA4J=#HsQauydu6TeJ+nyu#RPBl<_N^k7)uI;C zW1b)9bShg5pBm-yAE~eJ5TdVU{_lWSbY(Ws)A%>Xz7X>}jK3-IYl(kv;t%gM? + + + + Title of Test Page + + + + Body Text of Test Page + + diff --git a/test/test-script.js b/test/test-script.js new file mode 100644 index 0000000..a23567e --- /dev/null +++ b/test/test-script.js @@ -0,0 +1 @@ +console.log('hello from test script!'); diff --git a/test/test.c b/test/test.c old mode 100755 new mode 100644 index f715b44..b4fe5b4 --- a/test/test.c +++ b/test/test.c @@ -1,8 +1,3 @@ -//usr/bin/env cc -o test "$0" && ./test; exit - -// (run this file directly with `./test.c` in most shells; if that -// doesn't work, run it with `sh test.c`) - #include #include #include @@ -25,6 +20,7 @@ char* expand(char* phrase) { // expand path with wildcard // integration tests int main() { + // if you don't have node, comment this out, I guess: assert(system("node ../extension/background.js --unhandled-rejections=strict") == 0); // run quick local JS tests // reload the extension so we know it's the latest code. @@ -34,11 +30,19 @@ int main() { assert(file_contents_equal(expand("../fs/mnt/extensions/TabFS*/enabled"), "true")); - // FIXME: synthesize some kind of web page - assert(system("echo about:blank > ../fs/mnt/tabs/create") == 0); - // FIXME: race here - assert(file_contents_equal("../fs/mnt/tabs/last-focused/url.txt", "about:blank")); - assert(system("echo remove > ../fs/mnt/tabs/last-focused/control") == 0); + { + assert(system("echo about:blank > ../fs/mnt/tabs/create") == 0); + // FIXME: race here? + assert(file_contents_equal("../fs/mnt/tabs/last-focused/url.txt", "about:blank")); + assert(system("echo remove > ../fs/mnt/tabs/last-focused/control") == 0); + } + + { + assert(system("echo file://$(pwd)/test-page.html > ../fs/mnt/tabs/create") == 0); + assert(file_contents_equal("../fs/mnt/tabs/last-focused/title.txt", "Title of Test Page")); + assert(file_contents_equal("../fs/mnt/tabs/last-focused/text.txt", "Body Text of Test Page")); + assert(system("echo remove > ../fs/mnt/tabs/last-focused/control") == 0); + } assert(1); printf("Done!\n"); }