Package org.chromium.debug.core.sourcemap.SourcePositionMapBuilder

Examples of org.chromium.debug.core.sourcemap.SourcePositionMapBuilder.ResourceSection


   * Creates a sample position map and checks several points.
   */
  @Test
  public void basicTest() throws CannotAddException {
    SourcePositionMapBuilder builder = new PositionMapBuilderImpl();
    builder.addMapping(new ResourceSection(new VmResourceId("source1.js", null), 0, 0, 5, 0),
        new ResourceSection(new VmResourceId("compiled.js", null), 0, 0, 1, 0),
        new TextSectionMappingImpl(
            new StringMappingData(new int [] { 0,0, 1,02,03,04,0 } , 5, 0),
            new StringMappingData(new int [] { 0,0, 0,10, 0,20, 0,30, 0,40 }, 0, 50)));

    builder.addMapping(new ResourceSection(new VmResourceId("source2.js", null), 0, 0, 5, 0),
        new ResourceSection(new VmResourceId("compiled.js", null), 1, 0, 2, 0),
        new TextSectionMappingImpl(
            new StringMappingData(new int [] { 0,0, 1,02,03,04,0}, 5, 0),
            new StringMappingData(new int [] { 1,0, 1,10, 1,20, 1,30, 1,40}, 1, 50)));

    builder.addMapping(new ResourceSection(new VmResourceId("source3.js", null), 0, 0, 5, 0),
        new ResourceSection(new VmResourceId("compiled.js", null), 2, 0, 3, 0),
        new TextSectionMappingImpl(
            new StringMappingData(new int [] {0,0, 1,02,03,04,0}, 5, 0),
            new StringMappingData(new int [] {2,0, 2,10, 2,20, 2,30, 2,40}, 2, 50)));

    SourcePositionMap map = builder.getSourcePositionMap();
View Full Code Here


      return result;
    }

    protected static MappingHandle addSection(SourcePositionMapBuilder builder,
        ResourceSection vmSection, int index) throws CannotAddException {
      ResourceSection originalSection =
          new ResourceSection(new VmResourceId(("source" + index + ".js"), null), 0, 0, 5, 0);

      TextSectionMappingImpl textMapping = new TextSectionMappingImpl(
          new StringMappingData(
              new int [] { vmSection.getStart().getLine(), vmSection.getStart().getColumn() },
              vmSection.getEnd().getLine(), vmSection.getEnd().getColumn()),
View Full Code Here

TOP

Related Classes of org.chromium.debug.core.sourcemap.SourcePositionMapBuilder.ResourceSection

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.