Package org.chromium.sdk

Examples of org.chromium.sdk.Script


    latch.await();
    assertNotNull(loadedScript);
    Collection<Script> newScripts = getScripts();
    assertEquals(2, newScripts.size());
    newScripts.removeAll(scripts);
    Script compiledScript = newScripts.iterator().next();
    assertEquals(FixtureChromeStub.getCompiledScriptId(), compiledScript.getId());
    assertEquals(loadedScript.getId(), compiledScript.getId());
    String source = compiledScript.getSource();
    assertTrue(source != null && source.contains("compiled()")); //$NON-NLS-1$
  }
View Full Code Here


  public int getIdentifier() {
    return frameId;
  }

  void hookUpScript(ScriptManager scriptManager) {
    Script script = scriptManager.findById(scriptId);
    if (script != null) {
      this.script = script;
    }
  }
View Full Code Here

    }

    Collection<Script> scripts = loadScripts(vm);

    // Finding script1.js script.
    Script scriptOne;
    lookForScript: {
      for (Script script : scripts) {
        String name = script.getName();
        if (name != null && name.endsWith(SCRIPT_ONE_NAME)) {
          scriptOne = script;
          break lookForScript;
        }
      }
      throw new SmokeException("Failed to find script " + SCRIPT_ONE_NAME);
    }

    // Getting a number of the line with the marker.
    int breakLine = findSourceMark(scriptOne, BREAKPOINT_MARK);
    if (breakLine == -1) {
      throw new SmokeException("Failed to find mark in script");
    }

    // Setting a breakpoint.
    CallbackSemaphore callbackSemaphore = new CallbackSemaphore();
    Breakpoint.Target breakpointTarget = new Breakpoint.Target.ScriptName(scriptOne.getName());
    RelayOk relayOk = vm.setBreakpoint(breakpointTarget, breakLine, 0, true, null,
        null, callbackSemaphore);
    callbackSemaphore.acquireDefault(relayOk);

    // First time just suspend on breakpoint and go on.
View Full Code Here

  private SourcePosition getUserPosition() {
    CachedUserPosition currentCachedPosition = userCachedSourcePosition;
    if (currentCachedPosition == null || currentCachedPosition.token.isUpdated()) {
      VmResourceId id;
      Script script = stackFrame.getScript();
      if (script == null) {
        id = null;
      } else {
        id = VmResourceId.forScript(script);
      }
View Full Code Here

  private SourcePosition getUserPosition() {
    CachedUserPosition currentCachedPosition = userCachedSourcePosition;
    if (currentCachedPosition == null || currentCachedPosition.token.isUpdated()) {
      VmResourceId id;
      Script script = stackFrame.getScript();
      if (script == null) {
        id = null;
      } else {
        id = VmResourceId.forScript(script);
      }
View Full Code Here

        SourcePositionMap positionMap = connectedTargetData.getSourcePositionMap();
        SourcePosition userPosition;
        {
          // First get VM positions.
          Script script = jsFunction.getScript();
          if (script == null) {
            return;
          }
          TextStreamPosition functionOpenParenPosition = jsFunction.getOpenParenPosition();
          if (functionOpenParenPosition == null) {
View Full Code Here

  public int getIdentifier() {
    return frameId;
  }

  void hookUpScript(ScriptManager scriptManager) {
    Script script = scriptManager.findById(scriptId);
    if (script != null) {
      this.script = script;
    }
  }
View Full Code Here

            }
            // body is an array of scripts
            if (body.size() == 0) {
              return; // The script did not arrive (bad id?)
            }
            Script newScript = debugSession.getScriptManager().addScript(
                body.get(0),
                successResponse.refs());
            if (newScript != null) {
              getDebugSession().getSessionManager().getDebugEventListener().scriptLoaded(newScript);
            }
View Full Code Here

    }

    Collection<Script> scripts = loadScripts(vm);

    // Finding script1.js script.
    Script scriptOne;
    lookForScript: {
      for (Script script : scripts) {
        String name = script.getName();
        if (name != null && name.endsWith(SCRIPT_ONE_NAME)) {
          scriptOne = script;
          break lookForScript;
        }
      }
      throw new SmokeException("Failed to find script " + SCRIPT_ONE_NAME);
    }

    // Getting a number of the line with the marker.
    int breakLine = findSourceMark(scriptOne, BREAKPOINT_MARK);
    if (breakLine == -1) {
      throw new SmokeException("Failed to find mark in script");
    }

    // Setting a breakpoint.
    CallbackSemaphore callbackSemaphore = new CallbackSemaphore();
    Breakpoint.Target breakpointTarget = new Breakpoint.Target.ScriptName(scriptOne.getName());
    RelayOk relayOk = vm.setBreakpoint(breakpointTarget, breakLine, 0, true, null,
        null, callbackSemaphore);
    callbackSemaphore.acquireDefault(relayOk);

    // First time just suspend on breakpoint and go on.
View Full Code Here

    }
  };

  private static VmResourceId getVmResourceId(Object object) throws CoreException {
    if (object instanceof Script) {
      Script script = (Script) object;
      return VmResourceId.forScript(script);
    } else if (object instanceof StackFrame) {
      StackFrame jsStackFrame = (StackFrame) object;
      return jsStackFrame.getVmResourceId();
    } else if (object instanceof Breakpoint) {
View Full Code Here

TOP

Related Classes of org.chromium.sdk.Script

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.