Commit ca6c54f7 authored by Arnold Hendriks's avatar Arnold Hendriks

more snowbeagle usage

parent e1733ac3
......@@ -60,7 +60,7 @@ MACRO CreateContent(OBJECT siteroot, BOOLEAN with_errors)
[ file := WrapBLob(StringToBlob(RepeatText("testfile", 64)), "testfile.txt")
]);
OBJECT image := siteroot->CreateFile([name:="bob.jpg", data := GetWebhareResource("mod::webhare_testsuite/data/test/bob.jpg"), publish := TRUE ]);
OBJECT image := siteroot->CreateFile([name:="bob.jpg", data := GetWebhareResource("mod::system/web/tests/snowbeagle.jpg"), publish := TRUE ]);
OBJECT simplexlsx := siteroot->CreateFile([name:="simple.xlsx", data := GetWebhareResource("whres::ooxml/template.xlsx"), publish := TRUE ]);
IF(with_errors)
......
......@@ -611,7 +611,7 @@ MACRO FillTestFormFile(OBJECT formfile, RECORD options)
{
STRING attachments := formdefs->CreateInstance(
[ whfstype := "http://www.webhare.net/xmlns/publisher/mailhandlerattachments"
, attachments := [ [ file := WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), "bob.jpg") ] ]
, attachments := [ [ file := WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), "bob.jpg") ] ]
]);
mailhandler2->SetAttribute("attachmentsid", attachments);
}
......@@ -704,7 +704,7 @@ MACRO FillTestFormFile(OBJECT formfile, RECORD options)
, data := [ htmltext := StringToBlob('<html><body>'
|| '<p class="normal">Ik ben een <b>&lt;normale&gt;</b> <a href="http://webhare.nl/">webhare</a> <i>[]paragraaf[]</i><br/>met\neen soft-break en een afbeelding: <img src="cid:imagecid-81400" class="wh-rtd__img--floatright" width="160" height="120" alt="I&amp;G" /></p>'
|| '</body></html>')
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), "bob.jpg")
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), "bob.jpg")
, contentid := "imagecid-81400"
]
]
......
......@@ -326,7 +326,7 @@ PUBLIC OBJECTTYPE IFrameTest EXTEND TolliumScreenBase
STRING FUNCTION GenerateContent(STRING source)
{
BLOB bobimage := GetWebhareResource("mod::webhare_testsuite/data/test/smallbob.jpg");
BLOB bobimage := GetWebhareResource("mod::system/web/tests/snowbeagle.jpg");
STRING link := this->iframe->AddEmbeddedObject(bobimage, "image/jpeg");
RETURN
......@@ -497,7 +497,7 @@ PUBLIC OBJECTTYPE ImageTest EXTEND TolliumScreenBase
MACRO DoUpdateImageData_Bob()
{
BLOB bobimage := GetWebhareResource("mod::webhare_testsuite/data/test/bob.jpg");
BLOB bobimage := GetWebhareResource("mod::system/web/tests/snowbeagle.jpg");
this->image->SetImage(bobimage, "bob.jpg");
}
MACRO DoUpdateImageUrl()
......
......@@ -255,8 +255,8 @@ PUBLIC OBJECTTYPE Main EXTEND TolliumScreenBase
MACRO DoInsertImage()
{
BLOB smallbobjpg := GetHarescriptResource("mod::webhare_testsuite/data/test/smallbob.jpg");
this->GetCurrentRTE()->InsertImage(smallbobjpg, "smallbob.jpg");
BLOB smallbobjpg := GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg");
this->GetCurrentRTE()->InsertImage(smallbobjpg, "snowbeagle.jpg");
}
MACRO DoInsertObject()
......
......@@ -48,7 +48,7 @@ MACRO Prepare()
myrichdoc->ImportFromRecord([ htmltext := StringToBlob('<html><head></head><body>'
|| '<p class="normal">blabla5</p>'
|| '</body></html>')
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
]);
richdoctype->SetInstanceData(file_5->id, [data := myrichdoc->ExportAsRecord()]);
......
......@@ -60,7 +60,7 @@ MACRO ConsilioTest()
|| '</tr>'
|| '</tbody></table>'
|| '</body></html>')
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
]);;
richdoctype->SetInstanceData(file_6->id, [data := myrichdoc->ExportAsRecord()]);
......
......@@ -25,7 +25,7 @@ ASYNC MACRO ObjectProps()
OBJECT root := OpenTestsuiteSite()->rootobject;
OBJECT propsfolder := GetTestsuiteTempFolder()->CreateFolder([name := "propstest"]);
OBJECT imgfile := propsfolder->CreateFile([name:="img.jpg", data := GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), publish := TRUE ]);
OBJECT imgfile := propsfolder->CreateFile([name:="img.jpg", data := GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), publish := TRUE ]);
OBJECT imglink := propsfolder->CreateFile([name:="imglink.jpg", type := 20, filelink := imgfile->id, publish := TRUE ]);
imglink->SetInstanceData("http://www.webhare.net/xmlns/beta/test"
, [ arraytest := [[ textcell := "Row 1" ]]]);
......
......@@ -191,7 +191,7 @@ PUBLIC ASYNC MACRO TestBuildCustomForm()
TT(":Sender name")->value := "testformfile-formeditapp";
TT(":Sender address")->value := "[email protected]";
BLOB img := GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg");
BLOB img := GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg");
TT("fragment1!attachments!files!addbutton")->action->ExecuteUpload([WrapBlob(img, "bob.jpg")]);
TestEq(1, Length(TT("fragment1!attachments!files!list")->rows));
......
......@@ -33,7 +33,7 @@ MACRO DirectFormStorage1()
STRING emailfieldname := SELECT AS STRING name FROM fields WHERE title = ":Email";
GetMember(liveform, "^" || emailfieldname)->value := "[email protected]";
RECORD source := WrapBlob(GetWebHareResource("mod::webhare_testsuite/data/test/bob.jpg"),"bob.jpg");
RECORD source := WrapBlob(GetWebHareResource("mod::system/web/tests/snowbeagle.jpg"),"bob.jpg");
liveform->^upload->value := source;
RECORD res := liveform->__SubmitFormNow();
......
......@@ -136,7 +136,7 @@ MACRO ParserApiTest()
|| '</tbody></table>'
|| '<code class="language-harescript">&lt;?wh Print("Hello, world")\n</code>'
|| '</body></html>')
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), "bob.jpg", [ extractdominantcolor := TRUE ])
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), "bob.jpg", [ extractdominantcolor := TRUE ])
, contentid := "imagecid-81400"
]
]
......@@ -150,7 +150,7 @@ MACRO ParserApiTest()
TestEQ(0, storeddata.embedded[0].rotation);
TestEQ(FALSE, storeddata.embedded[0].mirrored);
TestEQ(DEFAULT RECORD, storeddata.embedded[0].refpoint);
TestEQ("#6A6E4F", storeddata.embedded[0].dominantcolor);
TestEQ("#EBEDF0", storeddata.embedded[0].dominantcolor);
OBJECT structure := NEW RichDocumentStructure;
structure->LoadFromXML(MakeXMLDocument(GetHarescriptResource("mod::webhare_testsuite/data/test/custompage.structure.xml"))->documentelement, "http://www.webhare.net/xmlns/tollium/richstructure");
......@@ -244,7 +244,7 @@ MACRO RichDocInstanceTest()
STRING instanceid := myrichdoc->CreateInstance([ whfstype := "http://www.webhare.net/xmlns/webhare_testsuite/rtdinstancetest"
, ignored := "xyz" //should be removed by normalization
, aref := site->id
, img := WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"),"bob.jpg")
, img := WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"),"bob.jpg")
]);
TestEq([ whfstype := "http://www.webhare.net/xmlns/webhare_testsuite/rtdinstancetest"
......@@ -416,9 +416,9 @@ MACRO PublishRichDocImageTest()
|| '<p class="normal">alleen verticaal, te groot: <img src="cid:imagecid-81400" height="280"/></p>'
|| '<p class="normal">alleen verticaal, binnen grenzen: <img src="cid:imagecid-81400" height="140"/></p>'
|| '<p class="normal">alleen horizontaal, te groot: <img src="cid:imagecid-81400" width="320"/></p>'
|| '<p class="normal">alleen horizontaal, binnen grenzen: <img src="cid:imagecid-81400" width="160"/></p>'
|| '<p class="normal">alleen horizontaal, binnen grenzen: <img src="cid:imagecid-81400" width="120"/></p>'
|| '<p class="normal">geen hints: <img src="cid:imagecid-81400" /></p>')
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
]);;
richdoc->SaveToWHFS(testfile);
testfw->CommitWork();
......@@ -452,7 +452,7 @@ MACRO PublishRichDocImageTest()
TestEq(160, imgcanvas->width);
TestEq(120, imgcanvas->height);
OBJECT imgsrc := CreateResizedCanvasFromBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), [ method := "scale", setwidth := 160, setheight := 120 ]);
OBJECT imgsrc := CreateResizedCanvasFromBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), [ method := "scale", setwidth := 160, setheight := 120 ]);
imgsrc->SetImageSize(160,120);
TestEq(160, imgsrc->width);
TestEq(120, imgsrc->height);
......@@ -472,23 +472,23 @@ MACRO PublishRichDocImageTest()
TestEq("300", imgtags[2]->GetAttribute("width"));
TestEq("263", imgtags[2]->GetAttribute("height"));
//The fourth image, had height 280. 373x280 is too big, so it should be reduced to 300x225
//The fourth image, had height 280. 373x280 is too big, so it should be reduced to 300x199
TestEq("300", imgtags[3]->GetAttribute("width"));
TestEq("225", imgtags[3]->GetAttribute("height"));
//This one had height 140, that's okay. It should become 187x140
TestEq("187", imgtags[4]->GetAttribute("width"));
TestEq("199", imgtags[3]->GetAttribute("height"));
//This one had height 140, that's okay. It should become 211x140
TestEq("211", imgtags[4]->GetAttribute("width"));
TestEq("140", imgtags[4]->GetAttribute("height"));
//Width 320. 300x225 again
//Width 320. 300x199 again
TestEq("300", imgtags[5]->GetAttribute("width"));
TestEq("225", imgtags[5]->GetAttribute("height"));
//Width 160. should work out
TestEq("160", imgtags[6]->GetAttribute("width"));
TestEq("120", imgtags[6]->GetAttribute("height"));
TestEq("199", imgtags[5]->GetAttribute("height"));
//Width 120. should work out
TestEq("120", imgtags[6]->GetAttribute("width"));
TestEq("80", imgtags[6]->GetAttribute("height"));
//Unspecified. Should reduced to 330x225
//Unspecified. Should reduced to 300x199
TestEq("300", imgtags[7]->GetAttribute("width"));
TestEq("225", imgtags[7]->GetAttribute("height"));
TestEq("199", imgtags[7]->GetAttribute("height"));
}
MACRO IntLinktest()
......@@ -514,7 +514,7 @@ MACRO IntLinktest()
|| ' afbeelding: <img src="cid:imagecid-81400" width="160" height="120" alt="I&amp;G" /></p>'
|| '<p><a id="boblink" href="x-richdoclink:EXT#goto-bob">Link naar Bob</a></p>'
|| '</body></html>')
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
, embedded := [ MakeMergedRecord(WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"),"bob.jpg"), [ contentid := "imagecid-81400" ]) ]
, links := [[ tag := "1234-5678-001", linkref := workfolder->id ]]
]);;
......
......@@ -556,7 +556,7 @@ ASYNC MACRO TestMailWitty()
|| '<div class="wh-rtd-embeddedobject" data-instanceid="B1ra7ve1TrCwfdusGy9kOxg"></div>'
|| '<div class="wh-rtd-embeddedobject" data-instanceid="xxya7ve1TrCwfdusGy9kOxg"></div>'
|| '</body></html>')
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), "bob.jpg", [ extractdominantcolor := TRUE ])
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), "bob.jpg", [ extractdominantcolor := TRUE ])
, contentid := "imagecid-81400"
]
]
......@@ -627,7 +627,7 @@ ASYNC MACRO TestMailWitty()
//test whether embedded images survived
TestEq(TRUE, onqueuedmail_lastoptions.toppart.mimetype LIKE "multipart/mixed");
TestEq(TRUE, onqueuedmail_lastoptions.toppart.subparts[0].mimetype LIKE "multipart/related");
TestEq(TRUE, RecordExists(SELECT FROM onqueuedmail_lastoptions.toppart.subparts[0].subparts WHERE filename LIKE "*.jpg" AND Length(data)=Length(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"))));
TestEq(TRUE, RecordExists(SELECT FROM onqueuedmail_lastoptions.toppart.subparts[0].subparts WHERE filename LIKE "*.jpg" AND Length(data)=Length(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"))));
TestEq(FALSE, RecordExists(SELECT FROM onqueuedmail_lastoptions.toppart.subparts[0].subparts WHERE filename LIKE "*..jpg"));
Testeq(1,Length(testfw->extractallmailfor("[email protected]")));
......
......@@ -75,7 +75,7 @@ MACRO SimpleTest()
TestThrows(PTR GetWebhareResource("filebyid::" || testfile->id));
TestThrows(PTR GetHareScriptResource("filebyid::" || testfile->id));
TestEq(299732, Length(subfolder2->Getresource("mod::webhare_testsuite/data/test/bob.jpg")));
TestEq(45081, Length(subfolder2->Getresource("mod::system/web/tests/snowbeagle.jpg")));
TestEq(5829, Length(subfolder2->Getresource("whres::xml/xml.xsd")));
//Upload an empty file with a .witty extension - now gets no filetype
......
......@@ -108,7 +108,7 @@ test.registerTests(
// Test html content
test.eq('htmlcontent2', iframe.contentWindow.document.getElementById('source').dataset.source);
let imgpreload = await preload.promiseImage(iframe.contentWindow.document.getElementById('image').src);
test.eq(160, imgpreload.width);
test.eq(428, imgpreload.width);
// Do a JS call outside of loading stage
test.click(test.getMenu(['I03']));
......@@ -139,7 +139,7 @@ test.registerTests(
&& test.qS("iframe").contentWindow.document.getElementById('source').dataset.source == 'blobcontent4');
let imgpreload = await preload.promiseImage(test.qS("iframe").contentWindow.document.getElementById('image').src);
test.eq(160, imgpreload.width);
test.eq(428, imgpreload.width);
//next tes: grab links
test.click(test.getMenu(['I05']));
......
......@@ -18,7 +18,7 @@ LOADLIB "mod::publisher/lib/internal/rtd/service.whlib";
LOADLIB "mod::publisher/lib/internal/rtd/editable.whlib";
BLOB bobjpg := GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg");
BLOB bobjpg := GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg");
BLOB smallbobjpg := GetHarescriptResource("mod::webhare_testsuite/data/test/smallbob.jpg");
MACRO RegisterBlobInWebhareDB(BLOB data)
......
......@@ -411,8 +411,8 @@ test.registerTests(
let selection = rte.getEditor().getSelectionRange();
let img = selection.getElementsByTagName("img")[0];
test.true(img);
test.eq('160', img.getAttribute("width"));
test.eq('120', img.getAttribute("height"));
test.eq('428', img.getAttribute("width"));
test.eq('284', img.getAttribute("height"));
}
......
......@@ -1473,7 +1473,7 @@ MACRO TestGlobalAccessRules()
OBJECT image := testfw->GetTestSite()->rootobject->CreateFile(
[ name := "bob.jpg"
, data := GetWebhareResource("mod::webhare_testsuite/data/test/bob.jpg")
, data := GetWebhareResource("mod::system/web/tests/snowbeagle.jpg")
, publish := TRUE
]);
......
......@@ -180,7 +180,7 @@ MACRO TestSync()
Sleep(2); // make sure the org_0 and new_0 entities have different modificationdates
synctarget->^wrd_person->UpdateEntity(new_0,
[ etest_domain := new_1
, etest_file := WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), "bob.jpg")
, etest_file := WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), "bob.jpg")
, etest_array := [ [ text := "t3" ] ]
, etest_array2 := [ [ text := "t4", text2 := "t5" ] ]
]);
......@@ -403,11 +403,11 @@ MACRO TestLocalBlobUsage()
OBJECT entity := testfw->GetWRDSchema()->^wrd_person->CreateEntity(
[ test_file := WrapBlob(StringToBlob("string file"), "filename.text")
, test_image := WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), "bob.jpg")
, test_image := WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), "bob.jpg")
, richie := [ htmltext := StringToBlob('<html><body>'
|| '<p class="normal">Ik ben een <b>&lt;normale&gt;</b> <a href="http://webhare.nl/">webhare</a> <i>[]paragraaf[]</i><br/>met\neen soft-break en een afbeelding: <img src="cid:imagecid-81400" class="wh-rtd__img--floatright" width="160" height="120" alt="I&amp;G" /></p>'
|| '</body></html>')
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::webhare_testsuite/data/test/bob.jpg"), "bob.jpg")
, embedded := [ CELL[...WrapBlob(GetHarescriptResource("mod::system/web/tests/snowbeagle.jpg"), "bob.jpg")
, contentid := "imagecid-81400"
]
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment