@@ -91,7 +91,7 @@ void TestQgsComposerHtml::sourceMode()
91
91
htmlFrame->setFrameEnabled ( true );
92
92
htmlItem->addFrame ( htmlFrame );
93
93
htmlItem->setContentMode ( QgsComposerHtml::ManualHtml );
94
- htmlItem->setHtml ( QString ( " <p style=\" font-family: %1 \" ><i>Test manual <b>html</b ></i></p> " ). arg ( mTestFont . family () ) );
94
+ htmlItem->setHtml ( QString ( " <body style=\" margin: 10px; \" ><div style= \" width: 100px; height: 50px; background-color: red; \" ></div ></body> " ) );
95
95
htmlItem->loadHtml ();
96
96
97
97
QgsCompositionChecker checker ( " composerhtml_manual" , mComposition );
@@ -108,10 +108,10 @@ void TestQgsComposerHtml::userStylesheets()
108
108
htmlFrame->setFrameEnabled ( true );
109
109
htmlItem->addFrame ( htmlFrame );
110
110
htmlItem->setContentMode ( QgsComposerHtml::ManualHtml );
111
- htmlItem->setHtml ( QString ( " <p style=\" font-family: %1 \" ><i>Test user stylesheets <b>html</b ></i></p> " ). arg ( mTestFont . family () ) );
111
+ htmlItem->setHtml ( QString ( " <body style=\" margin: 10px; \" ><div style= \" width: 100px; height: 50px; background-color: red; \" ></div ></body> " ) );
112
112
113
113
// set user stylesheet
114
- htmlItem->setUserStylesheet ( QString ( " b { color: red; } i { color: green; }" ) );
114
+ htmlItem->setUserStylesheet ( QString ( " div { background- color: green !important ; }" ) );
115
115
// setting user stylesheet enabled automatically loads html
116
116
htmlItem->setUserStylesheetEnabled ( true );
117
117
@@ -130,7 +130,7 @@ void TestQgsComposerHtml::evalExpressions()
130
130
htmlItem->addFrame ( htmlFrame );
131
131
htmlItem->setContentMode ( QgsComposerHtml::ManualHtml );
132
132
htmlItem->setEvaluateExpressions ( true );
133
- htmlItem->setHtml ( QString ( " <p style=\" font-family: %1 \" >Test expressions = <i> [% 1 + 2 + 3%]</i ></p> " ). arg ( mTestFont . family () ) );
133
+ htmlItem->setHtml ( QString ( " <body style=\" margin: 10px; \" ><div style= \" width: [% 10 * 10 %]px; height: [% 30 + 20 %]px; background-color: [% 'yel' || 'low' %]; \" ></div ></body> " ) );
134
134
135
135
htmlItem->loadHtml ();
136
136
@@ -149,7 +149,7 @@ void TestQgsComposerHtml::evalExpressionsOff()
149
149
htmlItem->addFrame ( htmlFrame );
150
150
htmlItem->setContentMode ( QgsComposerHtml::ManualHtml );
151
151
htmlItem->setEvaluateExpressions ( false );
152
- htmlItem->setHtml ( QString ( " <p style=\" font-family: %1 \" >Test expressions = <i> [% 1 + 2 + 3%]</i ></p> " ). arg ( mTestFont . family () ) );
152
+ htmlItem->setHtml ( QString ( " <body style=\" margin: 10px; \" ><div style= \" width: [% 10 * 10 %]px; height: [% 30 + 20 %]px; background-color: [% 'yel' || 'low' %]; \" ></div ></body> " ) );
153
153
htmlItem->loadHtml ();
154
154
155
155
QgsCompositionChecker checker ( " composerhtml_expressions_disabled" , mComposition );
@@ -165,7 +165,7 @@ void TestQgsComposerHtml::table()
165
165
QgsComposerFrame* htmlFrame = new QgsComposerFrame ( mComposition , htmlItem, 0 , 0 , 100 , 200 );
166
166
htmlFrame->setFrameEnabled ( true );
167
167
htmlItem->addFrame ( htmlFrame );
168
- htmlItem->setUrl ( QUrl ( QString ( " file:///%1" ).arg ( QString ( TEST_DATA_DIR ) + QDir::separator () + " html_table .html" ) ) );
168
+ htmlItem->setUrl ( QUrl ( QString ( " file:///%1" ).arg ( QString ( TEST_DATA_DIR ) + QDir::separator () + " test_html .html" ) ) );
169
169
170
170
QgsCompositionChecker checker ( " composerhtml_table" , mComposition );
171
171
bool result = checker.testComposition ( mReport );
@@ -183,7 +183,7 @@ void TestQgsComposerHtml::tableMultiFrame()
183
183
htmlItem->setUseSmartBreaks ( false );
184
184
185
185
// page1
186
- htmlItem->setUrl ( QUrl ( QString ( " file:///%1" ).arg ( QString ( TEST_DATA_DIR ) + QDir::separator () + " html_table .html" ) ) );
186
+ htmlItem->setUrl ( QUrl ( QString ( " file:///%1" ).arg ( QString ( TEST_DATA_DIR ) + QDir::separator () + " test_html .html" ) ) );
187
187
htmlItem->frame ( 0 )->setFrameEnabled ( true );
188
188
QgsCompositionChecker checker1 ( " composerhtml_multiframe1" , mComposition );
189
189
bool result = checker1.testComposition ( mReport );
@@ -206,14 +206,14 @@ void TestQgsComposerHtml::htmlMultiFrameSmartBreak()
206
206
htmlItem->setUseSmartBreaks ( true );
207
207
208
208
// page1
209
- htmlItem->setUrl ( QUrl ( QString ( " file:///%1" ).arg ( QString ( TEST_DATA_DIR ) + QDir::separator () + " html_table .html" ) ) );
209
+ htmlItem->setUrl ( QUrl ( QString ( " file:///%1" ).arg ( QString ( TEST_DATA_DIR ) + QDir::separator () + " test_html .html" ) ) );
210
210
htmlItem->frame ( 0 )->setFrameEnabled ( true );
211
211
QgsCompositionChecker checker1 ( " composerhtml_smartbreaks1" , mComposition );
212
212
bool result = checker1.testComposition ( mReport );
213
213
214
214
// page2
215
215
QgsCompositionChecker checker2 ( " composerhtml_smartbreaks2" , mComposition );
216
- result = checker2.testComposition ( mReport , 1 ) && result;
216
+ result = checker2.testComposition ( mReport , 1 , 3000 ) && result;
217
217
218
218
mComposition ->removeMultiFrame ( htmlItem );
219
219
delete htmlItem;
0 commit comments