Skip to content

Commit

Permalink
Update manual test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Comandeer committed Apr 9, 2018
1 parent 284fdb8 commit 63aecaf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
5 changes: 2 additions & 3 deletions tests/plugins/easyimage/manual/progressbarundo.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ <h1>Sample editor</h1>
<p>Go on, put some content here.</p>
</div>

<script src="_helpers/tools.js"></script>
<script>
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) {
bender.ignore();
}

var IMG_URL = '%BASE_PATH%_assets/logo.png',
commonConfig = {
cloudServices_url: 'https://files.cke-cs.com/upload/',
cloudServices_token: 'dummy-token',
cloudServices_uploadUrl: easyImageTools.CLOUD_SERVICES_UPLOAD_GATEWAY,
cloudServices_tokenUrl: easyImageTools.CLOUD_SERVICES_TOKEN_URL,
on: {
instanceReady: function( evt ) {
var editor = evt.editor,
Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/easyimage/manual/progressbarundo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@bender-tags: 4.9.0, feature, 932
@bender-tags: 4.10.0, bug, 1532
@bender-ui: collapsed
@bender-ckeditor-plugins: sourcearea, wysiwygarea, floatingspace, toolbar, easyimage, undo, resize
@bender-include: ../../uploadwidget/manual/_helpers/xhr.js
@bender-include: ../../uploadwidget/manual/_helpers/xhr.js, ../_helpers/tools.js

## Progressbar with Undo

Expand Down
11 changes: 10 additions & 1 deletion tests/plugins/uploadwidget/manual/_helpers/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,22 @@ window.XMLHttpRequest = function() {
upload: {},

send: function( formData ) {
var total = formData.getTotal(),
var total = formData && formData.getTotal(),
loaded = 0,
step = Math.round( total / 10 ),
xhr = this,
onprogress = this.upload.onprogress,
onreadystatechange = this.onreadystatechange,
onload = this.onload;

// Request without any data is sent by Easy Image token fetcher.
if ( !formData ) {
xhr.status = 200;
xhr.readyState = 4;
xhr.responseText = 'dummy_response';
return onreadystatechange ? onreadystatechange() : onload();
}

// Wait 400 ms for every step.
interval = setInterval( function() {
// Add data to 'loaded' counter.
Expand Down

0 comments on commit 63aecaf

Please sign in to comment.