Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2010-10-20 17:34:16 +0000
committerChris Goldthorpe2010-10-20 17:34:16 +0000
commitcca0bad2b0306df4e73a7b60fa322c0f259fbc5d (patch)
treead5bdf4ff0f627ce95a6fb3bc53417bbfb58c89d /org.eclipse.ua.tests
parent0ef7ded23cd61062851a6bde6bd1b7743f05a895 (diff)
downloadeclipse.platform.ua-cca0bad2b0306df4e73a7b60fa322c0f259fbc5d.tar.gz
eclipse.platform.ua-cca0bad2b0306df4e73a7b60fa322c0f259fbc5d.tar.xz
eclipse.platform.ua-cca0bad2b0306df4e73a7b60fa322c0f259fbc5d.zip
Bug 328267 - [Help][Search] meta tag "description" does not contribute to search index
Diffstat (limited to 'org.eclipse.ua.tests')
-rw-r--r--org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.htm15
-rw-r--r--org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.xhtml17
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MetaKeywords.java10
3 files changed, 41 insertions, 1 deletions
diff --git a/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.htm b/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.htm
new file mode 100644
index 000000000..f8efb0728
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.htm
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv="Content-Language" content="en-us">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="description" content="basbanba">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>HTML doc with meta</title>
+</head>
+<body>
+
+This is a test for searchable word in description meta tag within an html document
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.xhtml b/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.xhtml
new file mode 100644
index 000000000..87a5c7745
--- /dev/null
+++ b/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.xhtml
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="description" content="mfjrudjesm" />
+<title>XHTML doc with meta</title>
+</head>
+
+<body>
+
+<p>
+This is a test for searchable word in description meta tag in XHTML file
+</p>
+
+</body>
+</html>
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MetaKeywords.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MetaKeywords.java
index 57f191662..0df50ecd1 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MetaKeywords.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/MetaKeywords.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -54,6 +54,14 @@ public class MetaKeywords extends TestCase {
assertEquals("XHTML Meta description", hits[0].getDescription());
}
+ public void testSearchDescriptionInHtml() {
+ SearchTestUtils.searchAllLocales("basbanba", new String[] { "/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.htm" });
+ }
+
+ public void testSearchDescriptionInXhtml() {
+ SearchTestUtils.searchAllLocales("mfjrudjesm", new String[] { "/org.eclipse.ua.tests/data/help/search/extraDir/testMeta2.xhtml" });
+ }
+
private SearchHit[] getResultDescriptions(String searchWord, String nl) {
ISearchQuery query = new SearchQuery(searchWord, false, new ArrayList(), nl);
SearchResults collector = new SearchResults(null, 500, nl);

Back to the top