Test 3: Installable Microsummary Generator

Introduction

This page links to an installable microsummary generator that generates the microsummary for this page. The link looks like this:

<a href="javascript:addGenerator('http://www.melez.com/mozilla/microsummaries/tests/test-3-generator.xml')">install microsummary generator</a>

The link calls the addGenerator() JavaScript function, which looks like this:

function addGenerator(url) {
  if (typeof window.sidebar == "object" &&
      typeof window.sidebar.addMicrosummaryGenerator == "function")
    window.sidebar.addMicrosummaryGenerator(url);
  else
    alert("Sorry, you need a microsummary-enabled browser to install and use microsummary generators.");
}

The generator looks like this:

<generator xmlns="http://www.mozilla.org/microsummaries/0.1"
           name="Test 3 Generator">
  <pages>
    <include>http://melez\.com/mozilla/microsummaries/tests/test-3-page\.html</include>
  </pages>
  <template>
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="text"/>
      <xsl:template match="/">
        <xsl:value-of select="/html/body/h1/span"/>
      </xsl:template>
    </xsl:transform>
  </template>
</generator>

Test Steps

Step 1: Click this link: install microsummary generator.

Expected Results: The Add Microsummary Generator confirmation dialog should appear. It should ask if you want to install the microsummary generator with the source URL http://www.melez.com/mozilla/microsummaries/tests/test-3-generator.xml.

Step 2: Press the OK button.

Expected Results: The Add Microsummary Generator dialog should disappear.

Step 3: From the Bookmarks menu, select Bookmark This Page....

Expected Results: The Add Bookmark dialog should appear. It should contain a Summary drop-down menu. A Don't Display a Summary menu item should be the selected item in the menu.

Step 4: Open the Summary drop-down menu.

Expected Results: The menu should contain one other item besides the selected item. If you open the menu before the browser has a chance to download the microsummary content, the other item's label should be the microsummary generator name: Test 3 Generator. Otherwise, the other item's label should be the microsummary itself: Test 3.

Step 5: Select the microsummary item from the Summary menu. Select the Bookmarks Toolbar item from the Create in: menu. Press the Add button.

Expected Results: The Add Bookmark dialog should disappear. A bookmark to this page should appear on the bookmarks toolbar. The label of the bookmark should be the microsummary: Test 3.