Package com.google.speedtracer.client.model

Examples of com.google.speedtracer.client.model.HintRecord


      final HintletReport.Css css = resources.hintletReportCss();
      // Hintlet Indicator(s)
      int severityCount[] = new int[4];
      for (int i = 0, j = hintletRecords.size(); i < j; i++) {
        HintRecord rec = hintletRecords.get(i);
        severityCount[rec.getSeverity()]++;
      }

      for (int i = 0, j = severityCount.length; i < j; i++) {
        if (severityCount[i] > 0) {
          HintletIndicator indicator = new HintletIndicator(rowContainer, i,
View Full Code Here


     * Adds the rows to the table. Assumes there are no data rows in the table.
     */
    private void populateSubTable() {
      final HintletReport.Css css = getResources().hintletReportCss();
      for (int i = 0, j = hintletRecords.size(); i < j; ++i) {
        HintRecord record = hintletRecords.get(i);
        TableRowElement rowElem = subTable.appendRow();
        if (i % 2 == 0) {
          rowElem.setClassName(css.reportTableEvenRow());
        }

        int length = columns.size();
        for (int cellIndex = 0; cellIndex < length; ++cellIndex) {
          TableCellElement cell = rowElem.insertCell(cellIndex);
          switch (columns.get(cellIndex)) {
            case COL_TIME:
              cell.setClassName(css.reportRowDetailTimeCell());
              cell.setInnerText(TimeStampFormatter.format(record.getTimestamp()));
              break;
            case COL_SEVERITY:
              cell.setClassName(css.reportRowDetailSeverityCell());
              // A colored square to indicate the severity
              DivElement severitySquare = DocumentExt.get().createDivWithClassName(
                  css.reportSeverityDot());
              cell.appendChild(severitySquare);
              severitySquare.getStyle().setProperty("backgroundColor",
                  HintletIndicator.getSeverityColor(record.getSeverity()));
              break;
            case COL_DESCRIPTION:
              cell.setClassName(css.reportRowDetailCell());
              cell.setInnerText(record.getDescription());
              break;
            case COL_RULE_NAME:
              cell.setClassName(css.reportRowDetailCell());
              cell.setInnerText(record.getHintletRule());
              break;
            default:
              // not a valid row type
              assert (false);
          }
View Full Code Here

   * @return a map of hints organized by rule name.
   */
  public Map<String, List<HintRecord>> getHintsByRule() {
    Map<String, List<HintRecord>> result = new TreeMap<String, List<HintRecord>>();
    for (int i = 0, j = hints.size(); i < j; ++i) {
      HintRecord rec = hints.get(i);
      List<HintRecord> list = result.get(rec.getHintletRule());
      if (list == null) {
        list = new ArrayList<HintRecord>();
        result.put(rec.getHintletRule(), list);
      }
      list.add(rec);
    }
    return result;
  }
View Full Code Here

   * @return
   */
  public Map<Integer, List<HintRecord>> getHintsBySeverity() {
    Map<Integer, List<HintRecord>> result = new TreeMap<Integer, List<HintRecord>>();
    for (int i = 0, j = hints.size(); i < j; ++i) {
      HintRecord rec = hints.get(i);
      List<HintRecord> list = result.get(Integer.valueOf(rec.getSeverity()));
      if (list == null) {
        list = new ArrayList<HintRecord>();
        result.put(Integer.valueOf(rec.getSeverity()), list);
      }
      list.add(rec);
    }
    return result;
  }
View Full Code Here

      final HintletReport.Css css = resources.hintletReportCss();
      // Hintlet Indicator(s)
      int severityCount[] = new int[4];
      for (int i = 0, j = hintletRecords.size(); i < j; i++) {
        HintRecord rec = hintletRecords.get(i);
        severityCount[rec.getSeverity()]++;
      }

      for (int i = 0, j = severityCount.length; i < j; i++) {
        if (severityCount[i] > 0) {
          HintletIndicator indicator = new HintletIndicator(rowContainer, i,
View Full Code Here

    int infoCount = 0;
    int validationCount = 0;
    int numHints = hintRecords.size();

    for (int i = 0; i < numHints; i++) {
      HintRecord rec = hintRecords.get(i);
      switch (rec.getSeverity()) {
        case HintRecord.SEVERITY_VALIDATION:
          validationCount++;
          break;
        case HintRecord.SEVERITY_CRITICAL:
          criticalCount++;
View Full Code Here

      labelText.setInnerText(" " + HintRecord.severityToString(severity));

      // Add child nodes.
      for (int i = 0; i < hintletRecords.size(); i++) {
        HintRecord rec = hintletRecords.get(i);
        if (rec.getSeverity() == severity) {
          new HintletRecordItem(this, rec, tree);
        }
      }
    }
View Full Code Here

    String hintDescription =
        "The following resources are missing a cache expiration."
            + " Resources that do not specify an expiration may not be cached by browsers."
            + " Specify an expiration at least one month in the future for resources that"
            + " should be cached, and an expiration in the past for resources that should not be cached:" + " http://www.google.com";
    HintRecord expectedHint = createHintRecord(hintDescription, HintRecord.SEVERITY_CRITICAL);
    runCacheTest(responseBuilder.getEvent(), DEFAULT_URL, expectedHint);
  }
View Full Code Here

    String hintDescription =
        "The following resources specify a 'Vary' header"
            + " that disables caching in most versions of Internet Explorer."
            + " Fix or remove the 'Vary' header for the following resources:"
            + " http://www.google.com";
    HintRecord hint = createHintRecord(hintDescription, HintRecord.SEVERITY_CRITICAL);

    runCacheTest(responseBuilder.getEvent(), DEFAULT_URL, hint);
  }
View Full Code Here

    String hintDescription =
        "The following resources specify a 'Vary' header"
            + " that disables caching in most versions of Internet Explorer."
            + " Fix or remove the 'Vary' header for the following resources:"
            + " http://www.google.com";
    HintRecord expectedHint = createHintRecord(hintDescription, HintRecord.SEVERITY_CRITICAL);

    runCacheTest(responseBuilder.getEvent(), DEFAULT_URL, expectedHint);
  }
View Full Code Here

TOP

Related Classes of com.google.speedtracer.client.model.HintRecord

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.