Changeset 123978 in webkit


Ignore:
Timestamp:
Jul 29, 2012 2:49:14 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Extend application/x-webkit-test-netscape plugins to better support multiple frames.
https://bugs.webkit.org/show_bug.cgi?id=92478

Patch by Mike West <mkwst@chromium.org> on 2012-07-29
Reviewed by Adam Barth.

Tools:

DumpRenderTree currently understands
<object src="data:application/x-webkit-test-netscape,alertwhenloaded">.
It would be useful if it understood logifloaded, which could give
more context regarding test expectations, and can be written in such
as way as to support plugins loaded into multiple iframes in a single
test.

  • DumpRenderTree/TestNetscapePlugIn/main.cpp:

(NPP_New):

Adding support for logifloaded.

LayoutTests:

  • http/tests/plugins/resources/mock-plugin-logger.js:

Exciting JS "framework" for use when logging via logifloaded.

  • http/tests/security/contentSecurityPolicy/object-src-none-allowed.html:
  • http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.html:
  • http/tests/security/contentSecurityPolicy/object-src-none-blocked.html:
  • http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.html:

Adjusting these tests to use the newly created logifloaded plugin mock.

  • http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl:

Loading mock-plugin-logger.js, and adding a log attribute for logifloaded.

Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123977 r123978  
     12012-07-29  Mike West  <mkwst@chromium.org>
     2
     3        Extend `application/x-webkit-test-netscape` plugins to better support multiple frames.
     4        https://bugs.webkit.org/show_bug.cgi?id=92478
     5
     6        Reviewed by Adam Barth.
     7
     8        * http/tests/plugins/resources/mock-plugin-logger.js:
     9            Exciting JS "framework" for use when logging via `logifloaded`.
     10        * http/tests/security/contentSecurityPolicy/object-src-none-allowed.html:
     11        * http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.html:
     12        * http/tests/security/contentSecurityPolicy/object-src-none-blocked.html:
     13        * http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.html:
     14            Adjusting these tests to use the newly created `logifloaded` plugin mock.
     15        * http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl:
     16            Loading `mock-plugin-logger.js`, and adding a `log` attribute for `logifloaded`.
     17
    1182012-07-28  Dan Bernstein  <mitz@apple.com>
    219
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.txt

    r84457 r123978  
    1 ALERT: Plugin Loaded!
    21
    32
     
    54Frame: '<!--framePath //<!--frame0-->-->'
    65--------
     6PASS!
    77
     8
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed.html

    r120174 r123978  
    1010</head>
    1111<body>
    12   <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-object-data.pl?q=data:application/x-webkit-test-netscape,alertwhenloaded&csp=img-src%20'none'"></iframe>
     12  <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-object-data.pl?q=data:application/x-webkit-test-netscape,logifloaded&log=PASS!&csp=img-src%20'none'"></iframe>
    1313</body>
    1414</html>
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt

    r117006 r123978  
    1 CONSOLE MESSAGE: Refused to load the object 'data:application/x-webkit-test-netscape,alertwhenloaded' because it violates the following Content Security Policy directive: "object-src 'none'".
     1CONSOLE MESSAGE: Refused to load the object 'data:application/x-webkit-test-netscape,logifloaded' because it violates the following Content Security Policy directive: "object-src 'none'".
    22
    33
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked.html

    r120174 r123978  
    1010</head>
    1111<body>
    12   <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-object-data.pl?q=data:application/x-webkit-test-netscape,alertwhenloaded&csp=object-src%20'none'"></iframe>
     12  <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-object-data.pl?q=data:application/x-webkit-test-netscape,logifloaded&log=FAIL&csp=object-src%20'none'"></iframe>
    1313</body>
    1414</html>
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl

    r83141 r123978  
    1111print "<html>\n";
    1212print "<body>\n";
    13 print "<object data=\"".$cgi->param('q')."\"></object>\n";
     13print "<script src=\"/plugins/resources/mock-plugin-logger.js\"></script>\n";
     14print "<object data=\"".$cgi->param('q')."\" log=\"".$cgi->param('log')."\"></object>\n";
    1415print "</body>\n";
    1516print "</html>\n";
  • trunk/Tools/ChangeLog

    r123968 r123978  
     12012-07-29  Mike West  <mkwst@chromium.org>
     2
     3        Extend `application/x-webkit-test-netscape` plugins to better support multiple frames.
     4        https://bugs.webkit.org/show_bug.cgi?id=92478
     5
     6        Reviewed by Adam Barth.
     7
     8        DumpRenderTree currently understands
     9        `<object src="data:application/x-webkit-test-netscape,alertwhenloaded">`.
     10        It would be useful if it understood `logifloaded`, which could give
     11        more context regarding test expectations, and can be written in such
     12        as way as to support plugins loaded into multiple iframes in a single
     13        test.
     14
     15        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
     16        (NPP_New):
     17            Adding support for `logifloaded`.
     18
    1192012-07-28  Peter Kasting  <pkasting@google.com>
    220
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp

    r113901 r123978  
    203203                 strcasecmp(argv[i], "data:application/x-webkit-test-netscape,alertwhenloaded") == 0)
    204204            executeScript(obj, "alert('Plugin Loaded!')");
    205         else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
     205        else if (strcasecmp(argn[i], "src") == 0 &&
     206                 strcasecmp(argv[i], "data:application/x-webkit-test-netscape,logifloaded") == 0) {
     207            for (int j = 0; j < argc; j++) {
     208              if (strcasecmp(argn[j], "log") == 0) {
     209                int length = 26 + strlen(argv[j]) + 1;
     210                char* buffer = (char*) malloc(length);
     211                snprintf(buffer, length, "xWebkitTestNetscapeLog('%s')", argv[j]);
     212                executeScript(obj, buffer);
     213                free(buffer);
     214              }
     215            }
     216        } else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
    206217            obj->onSetWindow = strdup(argv[i]);
    207218        else if (strcasecmp(argn[i], "onNew") == 0 && !onNewScript)
Note: See TracChangeset for help on using the changeset viewer.