Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    Code:
    <!doctype html>
    <!--
    Copyright 2008 Google Inc.
    
    Licensed under the Apache License, Version 2.0 (the "License"); you may not
    use this file except in compliance with the License. You may obtain a copy of
    the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    License for the specific language governing permissions and limitations under
    the License.
    -->
    <html>
    <head>
    <meta charset="utf-8">
    <meta name='gwt:onLoadErrorFn' content='junitOnLoadErrorFn'>
    <meta name='gwt:onPropertyErrorFn' content='junitOnPropertyErrorFn'>
    </head>
    <body>
    <script>
    function junitOnLoadErrorFn(moduleName, e) {
      junitLaunchError('Failed to load module ' + moduleName + ': ' + e);
    }
    
    function junitOnPropertyErrorFn(propName, allowedValues, badValue) {
      var msg = 'While attempting to load the module, property "' + propName;
      if (badValue != null) {
        msg += '" was set to the unexpected value "' + badValue + '"';
      } else {
        msg += '" was not specified';
      }
      msg += 'Allowed values: ' + allowedValues;
      junitLaunchError(msg);
    }
    
    function junitLaunchError(msg) {
      junitError("/launch", msg);
    }
    
    function junitError(type, msg) {
      var xmlHttpRequest = new XMLHttpRequest();
      xmlHttpRequest.open('POST', 'junithost/error' + type, true);
      xmlHttpRequest.setRequestHeader('Content-Type', 'text/x-gwt-rpc; charset=utf-8');
      xmlHttpRequest.send(msg);
      if (window.console && window.console.log) {
        window.console.log(type + " error: " + msg);
      }
    }
    
    function loadSelectionScript() {
      var moduleName = location.pathname;
      var pos = moduleName.lastIndexOf('/');
      moduleName = moduleName.substr(0, pos);
      pos = moduleName.lastIndexOf('/');
      moduleName = moduleName.substr(pos + 1);
      document.write('<script language="javascript" src="' + encodeURIComponent(moduleName) + '.nocache.js"><\/script>');
    }
    loadSelectionScript();
    </script>
    </body>
    </html>

    Comment


      #17
      Our sample project HTML actually performs several tasks in addition to simply calling the <module>.nocache.js file - including setting the isomorphicDir var and loading our DataSources. We don't see anything in that (presumably automatically generated) junit.html that accomplishes those tasks. If you switch to GWT 2.6.1, which doesn't need our linker hack, do things work? Based on that junit.html, it looks like your isomorphicDir var would still be undefined and thus the skins would still be missing.

      You may want to ask other users of that tool suite how to execute JS from the original HTML page during the test process. It seems to be a problem with that tool suite that you're facing now.

      Comment


        #18
        We've encountered another user in a similar situation - you can see the key post from that thread here. It occurred to us that you might be able to use the suggested approach of an "extra.js" script to solve your remaining skin issues by setting isomorphicDir in that file. Just slot in the <script> dependency mentioned in that post into your module file below all other module dependencies.

        Comment

        Working...
        X