summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/the-dropzone-attribute/dropzone_attribute_data_item_kind_file-manual.html
blob: 7a77c12414fe8da9fce27443c3aca8f88bf43130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>HTML Test: dropzone_attribute_data_item_kind_file</title>
    <link rel='author' title='Intel' href='http://www.intel.com'>
    <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-dropzone-attribute'>
    <script src='/resources/testharness.js'></script>
    <script src='/resources/testharnessreport.js'></script>
    <style>
      #drop {
        border: 2px solid black;
        width: 160px;
        height: 160px;
        padding: 20px;
        color: white;
      }
      img {
        margin: 20px auto;
      }
    </style>
  </head>

  <body>
    <img src='/images/blue.png' alt='blue image' />
    <div>Save the blue image (image/png) above to your desktop, drag the image from desktop to the blue text to rectangular box in browser.</div>
    <div id='drop' dropzone='copy file:image/png'></div>
    <div id='log'> </div>

    <script>
      var drop;
      setup(function() {
          drop = document.querySelector('#drop');
      }, {explicit_done: true, explicit_timeout: true});

      on_event(drop, 'drop', function(event) {
        var item = event.dataTransfer.items[0];
        test(function() {
          assert_equals(item.kind, 'file',  'data item kind is file');
        }, 'data item kind is file');
        done();
      });
    </script>
  </body>
</html>