summaryrefslogtreecommitdiff
path: root/xml/tests
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2013-02-08 15:14:04 -0800
committerJean-Baptiste Queru <jbq@google.com>2013-02-08 15:14:04 -0800
commit9edc8f6b58f71ec510ba36b838f115718d9a174d (patch)
tree06f6df92024fa534ff27e1c0b5fc8b2002848093 /xml/tests
parentb56ea2a18f232d79481e778085fd64e8ae486fc3 (diff)
downloadidea-9edc8f6b58f71ec510ba36b838f115718d9a174d.tar.gz
Snapshot of commit 84dc01e773388c2c72a1fc437f313dd5747e7809
from branch master of git://git.jetbrains.org/idea/community.git
Diffstat (limited to 'xml/tests')
-rw-r--r--xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java48
-rw-r--r--xml/tests/testData/structureView/Empty.html0
-rw-r--r--xml/tests/testData/structureView/Empty.tree1
-rw-r--r--xml/tests/testData/structureView/ImplicitSections.html47
-rw-r--r--xml/tests/testData/structureView/ImplicitSections.tree24
-rw-r--r--xml/tests/testData/structureView/NoSectioningRoot.html17
-rw-r--r--xml/tests/testData/structureView/NoSectioningRoot.tree9
-rw-r--r--xml/tests/testData/structureView/Simple.html6
-rw-r--r--xml/tests/testData/structureView/Simple.tree2
9 files changed, 154 insertions, 0 deletions
diff --git a/xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java b/xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java
new file mode 100644
index 000000000000..d3d79b2b34e1
--- /dev/null
+++ b/xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java
@@ -0,0 +1,48 @@
+package com.intellij.xml.structureView;
+
+import com.intellij.ide.util.FileStructurePopup;
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.lang.html.structureView.Html5SectionsNodeProvider;
+import com.intellij.testFramework.FileStructureTestBase;
+
+public class HtmlFileStructureTest extends FileStructureTestBase {
+
+ private boolean myHtml5OutlineModeDefault;
+
+ public void setUp() throws Exception {
+ super.setUp();
+ myHtml5OutlineModeDefault = PropertiesComponent.getInstance().getBoolean(getHtml5OutlineModePropertyName(), false);
+ setHtml5OutlineMode(true);
+ }
+
+ public void tearDown() throws Exception {
+ PropertiesComponent.getInstance().setValue(getHtml5OutlineModePropertyName(), String.valueOf(myHtml5OutlineModeDefault));
+ super.tearDown();
+ }
+
+ private static String getHtml5OutlineModePropertyName() {
+ return FileStructurePopup.getPropertyName(Html5SectionsNodeProvider.HTML5_OUTLINE_PROVIDER_PROPERTY);
+ }
+
+ protected String getFileExtension() {
+ return "html";
+ }
+
+ protected String getBasePath() {
+ return "/xml/tests/testData/structureView/";
+ }
+
+ protected boolean isCommunity() {
+ return true;
+ }
+
+ public void setHtml5OutlineMode(boolean enabled) throws Exception {
+ myPopup.setTreeActionState(Html5SectionsNodeProvider.class, enabled);
+ update();
+ }
+
+ public void testEmpty() throws Exception {checkTree();}
+ public void testSimple() throws Exception {checkTree();}
+ public void testNoSectioningRoot() throws Exception {checkTree();}
+ public void testImplicitSections() throws Exception {checkTree();}
+}
diff --git a/xml/tests/testData/structureView/Empty.html b/xml/tests/testData/structureView/Empty.html
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xml/tests/testData/structureView/Empty.html
diff --git a/xml/tests/testData/structureView/Empty.tree b/xml/tests/testData/structureView/Empty.tree
new file mode 100644
index 000000000000..becaf0af7fde
--- /dev/null
+++ b/xml/tests/testData/structureView/Empty.tree
@@ -0,0 +1 @@
++HtmlFile:Empty.html \ No newline at end of file
diff --git a/xml/tests/testData/structureView/ImplicitSections.html b/xml/tests/testData/structureView/ImplicitSections.html
new file mode 100644
index 000000000000..32314bf6729f
--- /dev/null
+++ b/xml/tests/testData/structureView/ImplicitSections.html
@@ -0,0 +1,47 @@
+<html>
+<body>
+<article>
+ <div><h4>section</h4></div>
+ <h5>h5</h5>
+ <h4>h4</h4>
+ <h3>h3</h3>
+ <p>
+ <h4>hh4</h4>
+ <h5>hh5</h5>
+ <aside>
+ <div>
+ <hgroup>
+ <h4>h4</h4>
+
+ <h3>h3</h3>
+ </hgroup>
+ <h4>hh4</h4>
+ <h3>hh3</h3>
+ <figure>
+ <nav>
+ <div>
+ <hgroup>
+ </hgroup>
+ <h2>hhh2</h2>
+ <h1>hhh1</h1>
+ </div>
+ </nav>
+ </figure>
+ </div>
+ </aside>
+ <h6>hh6</h6>
+ <h6>hhh6</h6>
+ </p>
+ <h5>hhh5</h5>
+ <h4>g4</h4>
+ <h6>g6</h6>
+ <h3>g3</h3>
+ <h2>g2</h2>
+</article>
+<div>
+ <h3>body</h3>
+</div>
+<h1>body2</h1>
+<h2>body3</h2>
+</body>
+</html> \ No newline at end of file
diff --git a/xml/tests/testData/structureView/ImplicitSections.tree b/xml/tests/testData/structureView/ImplicitSections.tree
new file mode 100644
index 000000000000..9903463aa790
--- /dev/null
+++ b/xml/tests/testData/structureView/ImplicitSections.tree
@@ -0,0 +1,24 @@
+-HtmlFile:ImplicitSections.html
+ -body
+ -[section]
+ h5
+ h4
+ -h3
+ -hh4
+ hh5
+ -h4 h3
+ hh4
+ hh3
+ hh6
+ hhh6
+ hhh5
+ -g4
+ g6
+ g3
+ g2
+ -body2
+ body3
+ -
+ -
+ hhh2
+ hhh1 \ No newline at end of file
diff --git a/xml/tests/testData/structureView/NoSectioningRoot.html b/xml/tests/testData/structureView/NoSectioningRoot.html
new file mode 100644
index 000000000000..d0b4849a0d9b
--- /dev/null
+++ b/xml/tests/testData/structureView/NoSectioningRoot.html
@@ -0,0 +1,17 @@
+<section>
+ <blockquote>blockquote</blockquote>
+ <body>body</body>
+ <details>details</details>
+ <dialog>dialog</dialog>
+ <fieldset>fieldset</fieldset>
+ <figure>figure</figure>
+ <td>td</td>
+ <hgroup>
+ <a/>
+ <h1>1</h1>
+ <h2>2</h2>
+ <div/>
+ <h3>3</h3>
+ <h4>4</h4>
+ </hgroup>
+</section> \ No newline at end of file
diff --git a/xml/tests/testData/structureView/NoSectioningRoot.tree b/xml/tests/testData/structureView/NoSectioningRoot.tree
new file mode 100644
index 000000000000..e63bb3297a2e
--- /dev/null
+++ b/xml/tests/testData/structureView/NoSectioningRoot.tree
@@ -0,0 +1,9 @@
+-HtmlFile:NoSectioningRoot.html
+ [1 2 3 4]
+ blockquote
+ body
+ details
+ dialog
+ fieldset
+ figure
+ td \ No newline at end of file
diff --git a/xml/tests/testData/structureView/Simple.html b/xml/tests/testData/structureView/Simple.html
new file mode 100644
index 000000000000..cb128240b9a9
--- /dev/null
+++ b/xml/tests/testData/structureView/Simple.html
@@ -0,0 +1,6 @@
+<html>
+<head><title>title</title></head>
+<body>
+
+</body>
+</html> \ No newline at end of file
diff --git a/xml/tests/testData/structureView/Simple.tree b/xml/tests/testData/structureView/Simple.tree
new file mode 100644
index 000000000000..4f8e03e31bd5
--- /dev/null
+++ b/xml/tests/testData/structureView/Simple.tree
@@ -0,0 +1,2 @@
+-HtmlFile:Simple.html
+ [] \ No newline at end of file